:root {
    --primary-color: #ff6b00;
    --text-color: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --column-colors: #2c3e50, #34495e, #4a6785, #5d829c, #719db3,
        #85b8ca, #99d3e1, #add8e6, #c1e6ed, #d5f0f4,
        #e9f8f9, #f0f9fa, #f7fcfc;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(45deg, #1a1a1a 0%, #2c3e50 100%);
    margin: 0;
    padding: 30px;
    min-height: 100vh;
    color: var(--text-color);
}

.table-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

h2 {
    text-align: center;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 600;
    text-transform: uppercase;
    margin: 40px 0 25px;
    position: relative;
    padding-bottom: 15px;
    width: 100%;
}

h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 100px;
    height: 4px;
    background: var(--primary-color);
    transform: translateX(-50%);
    border-radius: 2px;
}

.footer {
    position: fixed;
    bottom: 10px;
    right: 20px;
    font-size: 0.9em;
    color: #666;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 5px;
    margin-bottom: 30px;
    background: transparent;
}

td {
    padding: 8px;
    text-align: center;
    border-radius: 5px;
    transition: transform 0.2s ease;
}

td:hover {
    transform: translateY(-2px);
}

.einbau-and-controls {
    display: none;
    flex-direction: row;
    gap: 20px;
    width: 100%;
    align-items: flex-start;
}

.einbau-and-controls.active {
    display: flex;
}

.Einbau {
    background: rgba(0, 0, 0, 0);
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: #000000;
    max-width: clamp(400px, 60%, 800px);
    flex: 1;
    min-width: 0;
}

.Einbau td {
    background: rgba(214, 113, 113, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px;
    color: #fefefe;
    min-width: 60px;
}

.Einbau select {
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    color: #024310;
    border: 2px solid #000000;
    border-radius: 6px;
    padding: 4px 8px;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.3s ease;
    width: 100%;
}

#garnitur17, #garnitur18, #garnitur19, #garnitur20, #garnitur21, #garnitur22 {
    font-size: 16px;
}

.Einbau select:hover {
    border-color: #9a0404;
    box-shadow: 0 0 8px rgba(255, 107, 0, 0.3);
}

.Einbau .garnitur-label {
  color: #000000;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 17px;
  text-shadow:
      -1px -1px 0 #ffffff,
      1px -1px 0 #ffffff,
      -1px 1px 0 #ffffff,
      1px 1px 0 #ffffff;
}

button {
    position: relative;
    font-family: inherit;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.05em;
    border-radius: 0.6em;
    cursor: pointer;
    border: none;
    overflow: hidden;
    transition: transform 0.2s, opacity 0.2s;
}

button span {
    position: relative;
    z-index: 10;
    transition: color 0.4s;
    display: inline-flex;
    align-items: center;
    padding: 0.6em 1em;
}

.table-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -10%;
    width: 120%;
    height: 100%;
    background: #c8c8c8;
    transform: skew(30deg);
    transition: transform 0.4s cubic-bezier(0.3, 1, 0.8, 1);
    z-index: 0;
}

button:hover::before {
    transform: translate3d(100%, 0, 0);
}

button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

button:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.table-btn {
    background: linear-gradient(to right, #f9f9f9, #b5ecec);
    color: #040404;
    width: 100%;
}

.no-border {
    background: transparent !important;
}

.modern-divider {
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, transparent, var(--primary-color), transparent);
    position: relative;
    margin: 10px 0;
    overflow: visible;
    z-index: 10;
}


.modern-divider::before {
    left: 100%;
}

.modern-divider::after {
    right: 100;
}

.modern-divider span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 10px;
    background: linear-gradient(45deg, #1a1a1a, #2c3e50);
    border-radius: 4px;
    z-index: 11;
}

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 500;
}

.popup-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.popup-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    background: #ffffff;
    border-radius: 10px;
    padding: 25px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 25px var(--shadow-color);
    z-index: 1001;
    overflow-y: auto;
}

.popup-content.left {
    display: none;
}

.popup-content.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%);
}

.close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 6px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: #f93232;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    overflow: hidden;
}

.close-btn:hover {
    background: #ec2929;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.close-btn:active {
    transform: scale(0.95);
}

.dropdown-container {
    display: none;
    text-align: center;
    margin: 0 0 20px 0;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
}

.dropdown-container.active {
    display: flex;
}

.select-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.select-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-color);
}

.von-custom-select,
.auf-custom-select {
    position: relative;
    display: inline-block;
}

.von-custom-select .select-box,
.auf-custom-select .select-box {
    background: linear-gradient(to right, #00cc00, #009900);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    min-width: 100px;
    text-align: center;
}

.auf-custom-select .select-box {
    background: linear-gradient(to right, #00b7eb, #0088b3);
}

.custom-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    min-width: 180px;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    padding: 8px;
}

.custom-options.active {
    display: block;
}

.custom-options input[type="text"] {
    width: 100%;
    padding: 6px;
    margin-bottom: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 12px;
}

.custom-options div {
    width: 100%;
    margin: 3px 0;
    background: #f0f0f0;
    color: #333;
    padding: 5px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
}

.custom-options div:hover {
    background: #e0e0e0;
}

.custom-options div.hidden {
    display: none;
}

.action-btn {
    position: relative;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    min-width: 100px;
}

.load-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
}

.load-btn:hover {
    background: linear-gradient(135deg, #27ae60, #219653);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.load-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.2);
}

.control-btn {
    position: relative;
    padding: 6px 12px;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 80px;
}

.save-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
}

.save-btn:hover {
    background: linear-gradient(135deg, #2980b9, #2471a3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.save-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.reset-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.reset-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

.control-btn::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    pointer-events: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 0.6s linear;
    opacity: 0;
}

.control-btn:active::after {
    transform: scale(2);
    opacity: 1;
}

@keyframes ripple {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

.action-btn::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    pointer-events: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 0.6s linear;
    opacity: 0;
}

.action-btn:active::after {
    transform: scale(2);
    opacity: 1;
}

.toggle-btn {
    position: relative;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #fff;
    margin: 10px auto;
    display: block;
}

.toggle-btn.active {
    background: linear-gradient(135deg, #27ae60, #219653);
}

.toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(230, 126, 34, 0.4);
}

.toggle-btn.active:hover {
    box-shadow: 0 6px 15px rgba(39, 174, 96, 0.4);
}

.toggle-btn:active {
    transform: scale(0.98);
}

select {
    width: 100%;
    padding: 8px;
    border: 2px solid #3498db;
    border-radius: 5px;
    background-color: #fff;
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
}

.control-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    flex-shrink: 0;
}

.control-buttons {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

.save-time-container {
    display: flex;
    justify-content: flex-start;
}

.save-time {
    font-size: 14px;
    color: #fff;
    padding: 4px 8px;
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.save-time:empty::before {
    content: "! Kein Streckeneinbau gespeichert !";
    color: #e74c3c;
    font-weight: 500;
}

.save-time:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.arrow-right {
    width: 20px;
    height: 20px;
    position: relative;
    display: inline-block;
    margin: 0 8px;
}

.arrow-right::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 12px;
    height: 2px;
    background: var(--primary-color);
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.arrow-right::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 6px;
    height: 6px;
    border-top: 2px solid var(--primary-color);
    border-right: 2px solid var(--primary-color);
    transform: translateY(-50%) rotate(45deg);
    transition: all 0.3s ease;
}

.arrow-right:hover::before {
    width: 16px;
    background: #ffffff;
}

.arrow-right:hover::after {
    border-color: #0155b5;
}

.garnitur-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .table-container {
        flex-direction: column;
    }

    .einbau-and-controls.active {
        flex-direction: column;
    }

    .Einbau {
        max-width: 100%;
    }

    .control-section {
        width: 100%;
    }

    .control-buttons {
        justify-content: flex-start;
        width: 100%;
    }

    .save-time-container {
        width: 100%;
        justify-content: flex-start;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    h2 {
        margin: 25px 0 15px;
    }

    td {
        min-width: 100px;
    }

    .popup-content {
        width: 95%;
        max-width: none;
    }

    .dropdown-container.active {
        margin-top: 0;
        justify-content: flex-start;
    }

    .arrow-right {
        transform: rotate(90deg);
        margin: 8px 0;
    }

    .modern-divider::before,
    .modern-divider::after {
        width: 8px;
        height: 8px;
    }

    .modern-divider span {
        font-size: 14px;
        padding: 0 8px;
    }
}

.diff-highlight {
    color: #e74c3c;
    font-weight: bold;
    background: rgba(231, 76, 60, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

#confirmPopup {
    padding: 20px;
    text-align: center;
}

#confirmTitle {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

#confirmMessage {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 1rem;
}