﻿/* ========================================
   TRAFFIC BALANCER - MODERN DESIGN
   ======================================== */

.rotator-main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

/* Hero Section */
.rotator-hero {
    text-align: center;
    padding: 2rem 1rem 3rem;
    margin-bottom: 2rem;
}

.rotator-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.rotator-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 2rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #a78bfa;
}

.rotator-hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.rotator-hero-desc {
    font-size: 1.15rem;
    color: #cbd5e1;
    line-height: 1.6;
}

/* Main Form Container */
.rotator-container {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 3rem;
}

/* Input Groups */
.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.input-group input[type="text"],
.input-group input[type="url"] {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: #f8fafc;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.input-group input::placeholder {
    color: #64748b;
}

/* Link Inputs */
.link-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.link-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.link-row:hover {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(139, 92, 246, 0.2);
}

.link-row span:first-child {
    padding: 0.75rem 1rem !important;
    background: rgba(139, 92, 246, 0.2) !important;
    border-radius: 0.5rem !important;
    color: #f8fafc !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    min-width: 70px !important;
    text-align: center !important;
}

.link-row input[type="text"] {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: #f8fafc;
    font-size: 0.95rem;
}

.link-row input[type="text"]:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.1);
}

/* Weight Controls */
.weight-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 0.5rem;
}

.weight-display {
    font-weight: 700;
    color: #8b5cf6;
    min-width: 50px;
    text-align: right;
    font-size: 0.95rem;
}

.weight-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    min-width: 80px;
}

.weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.weight-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.6);
}

.weight-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.weight-input {
    width: 60px;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    text-align: center;
    font-size: 0.9rem;
    color: #f8fafc;
    font-weight: 600;
}

/* Buttons */
.btn-remove {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    min-width: 44px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-remove:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.btn-add {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 2px dashed rgba(139, 92, 246, 0.3);
    width: 100%;
    padding: 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.btn-add:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

/* Distribution Section */
.weight-section {
    margin-top: 2.5rem;
    padding: 2rem;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 1rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.weight-section h3 {
    margin: 0 0 1.5rem 0;
    color: #f8fafc;
    font-size: 1.2rem;
    font-weight: 700;
}

.distribution-preview {
    margin-top: 1.5rem;
}

.distribution-bar {
    display: flex;
    height: 50px;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.distribution-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s;
    position: relative;
}

.distribution-segment:hover {
    filter: brightness(1.15);
    transform: scaleY(1.05);
}

.distribution-total {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.75rem;
    border-radius: 0.5rem;
}

.distribution-total.valid {
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.distribution-total.invalid {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Result Box */
.result-box {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid rgba(16, 185, 129, 0.3);
    padding: 2rem;
    border-radius: 1rem;
    margin-top: 2rem;
    display: none;
}

.result-box.show {
    display: block;
    animation: slideInUp 0.4s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-box h3 {
    color: #10b981;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.magic-link {
    font-size: 1.1rem;
    font-weight: 600;
    color: #8b5cf6;
    word-break: break-all;
    margin: 1.5rem 0;
    background: rgba(255, 255, 255, 0.05);
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 2px dashed rgba(139, 92, 246, 0.3);
}

/* User Configs Section */
#userConfigsSection {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px dashed rgba(255, 255, 255, 0.1);
}

#userConfigsSection h3 {
    color: #f8fafc;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

#userConfigsList {
    display: grid;
    gap: 1.5rem;
}

/* Config Card */
.config-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.config-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Badges */
.badge-active {
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-inactive {
    color: #64748b;
    background: rgba(100, 116, 139, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Features Section */
.rotator-features {
    text-align: center;
    padding: 4rem 1rem;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 3rem;
}

.rotator-features h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 1rem;
}

.rotator-features p {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    transition: transform 0.3s ease;
}

.feature-icon svg {
    width: 32px;
    height: 32px;
}

.feature-icon-green {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.feature-icon-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.feature-icon-purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.feature-icon-orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.use-case-item {
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.use-case-item:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(15, 23, 42, 0.6);
}

.use-case-item:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.use-case-item h4 {
    color: #a78bfa;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.use-case-item p {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Multi Select Dropdown - Better Contrast */
.multi-select-container {
    position: relative;
    width: auto;
    min-width: 220px;
}

.multi-select-trigger {
    padding: 0.5rem 0.75rem !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 0.5rem !important;
    background: rgba(15, 23, 42, 0.6) !important;
    color: #f8fafc !important;
    font-size: 0.9rem !important;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600 !important;
}

.multi-select-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    width: 250px;
    background: rgba(30, 41, 59, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    border-radius: 0.5rem !important;
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
}

.multi-select-container.open .multi-select-options {
    display: block;
}

.multi-select-option {
    display: grid !important;
    grid-template-columns: 24px 1fr !important;
    gap: 8px !important;
    align-items: center;
    padding: 8px 12px !important;
    border-radius: 0.375rem !important;
    cursor: pointer;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
    margin: 0;
    color: #f8fafc !important;
    width: 100%;
    text-align: left !important;
    white-space: nowrap;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.multi-select-option input[type="checkbox"] {
    margin: 0 !important;
    justify-self: start;
    transform: scale(1.2);
    flex-shrink: 0;
    cursor: pointer;
}

.multi-select-option:hover {
    background: rgba(139, 92, 246, 0.2) !important;
    color: #ffffff !important;
}

@media (max-width: 1024px) {
    .link-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .weight-control {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .rotator-main-container {
        padding: 1rem 0.75rem;
    }

    .rotator-hero {
        padding: 1.5rem 1rem 2rem;
    }

    .rotator-container {
        padding: 1.5rem;
    }

    .link-row {
        padding: 0.75rem;
    }

    .weight-section {
        padding: 1.5rem;
    }

    .use-cases-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .rotator-hero-title {
        font-size: 1.75rem;
    }

    .rotator-container {
        padding: 1.25rem;
    }

    .link-row span:first-child {
        min-width: 60px;
        font-size: 0.85rem;
    }

    .weight-control {
        flex-direction: column;
        align-items: stretch;
    }

    .weight-display {
        text-align: center;
    }
}