/* Navigation */
nav {
    text-align: center;
    margin-bottom: 30px;
}

nav a {
    background: #21262d !important;
    color: #8b949e !important;
    border: 1px solid #30363d !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
}

nav a:hover {
    background: #30363d !important;
    color: #e1e4e8 !important;
}

nav a[style*="background: #337ab7"],
nav a[style*="background:#337ab7"] {
    background: #388bfd !important;
    color: white !important;
    border-color: #388bfd !important;
}

/* Form sections */
.partner-management,
.subscription-management {
    margin-bottom: 24px;
    padding: 24px;
    background: #0d1117;
    border-radius: 12px;
    border: 1px solid #21262d;
    position: relative;
}

.partner-management::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #238636 0%, #1a7f37 100%);
    border-radius: 12px 0 0 12px;
}

.subscription-management::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #388bfd 0%, #1f6feb 100%);
    border-radius: 12px 0 0 12px;
}

.partner-management h2,
.subscription-management h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #e1e4e8;
    font-weight: 600;
    font-size: 1.3em;
    text-align: left;
}

.add-partner-form,
.add-subscription-form {
    margin-top: 16px;
}

#add-partner-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

#add-subscription-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Form inputs */
#partner-name-input,
#subscription-email-input,
#custom-code-input,
#partner-select,
#plan-select,
#expiry-date,
#new-expiry-date {
    padding: 12px 14px;
    border: 1px solid #30363d;
    border-radius: 8px;
    font-size: 14px;
    background: #161b22;
    color: #e1e4e8;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#partner-name-input:focus,
#subscription-email-input:focus,
#custom-code-input:focus,
#partner-select:focus,
#plan-select:focus,
#expiry-date:focus,
#new-expiry-date:focus {
    outline: none;
    border-color: #388bfd;
    box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.15);
}

#partner-name-input::placeholder,
#subscription-email-input::placeholder,
#custom-code-input::placeholder {
    color: #484f58;
}

select {
    appearance: auto;
}

.expiry-section label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #8b949e;
    font-size: 0.9em;
}

/* Partners display */
.partners-display {
    margin-top: 30px;
}

.partners-display h2 {
    text-align: left;
}

.partner-group {
    margin-bottom: 20px;
    border: 1px solid #21262d;
    border-radius: 10px;
    overflow: hidden;
}

.partner-header {
    background: linear-gradient(135deg, #1f6feb 0%, #388bfd 100%);
    color: white;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 1.05em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.partner-header .partner-name {
    flex: 1;
}

.subscription-count {
    background: rgba(255, 255, 255, 0.15);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.subscriptions-list {
    background: #0d1117;
}

.subscription-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #21262d;
    transition: background 0.2s ease;
}

.subscription-item:last-child {
    border-bottom: none;
}

.subscription-item:hover {
    background: #161b22;
}

.subscription-item.expired {
    opacity: 0.5;
}

.subscription-item.expired .subscription-email {
    text-decoration: line-through;
}

.subscription-info {
    flex: 1;
}

.subscription-email {
    font-weight: 600;
    margin-bottom: 6px;
    color: #e1e4e8;
}

.subscription-details {
    font-size: 0.85em;
    color: #8b949e;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.subscription-details .password {
    font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
    background: #1c2128;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #30363d;
    font-size: 0.9em;
    color: #79c0ff;
}

.subscription-details .plan {
    background: rgba(56, 139, 253, 0.1);
    color: #79c0ff;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.85em;
    border: 1px solid rgba(56, 139, 253, 0.2);
}

.subscription-details .expiry {
    color: #8b949e;
}

.subscription-details .expiry.expired {
    color: #f85149;
    font-weight: 600;
}

.subscription-actions {
    display: flex;
    gap: 6px;
    margin-left: 12px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.edit-btn {
    background: #1f6feb;
    color: white;
}

.edit-btn:hover {
    background: #388bfd;
}

.remove-btn {
    background: #da3633;
    color: white;
}

.remove-btn:hover {
    background: #f85149;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #161b22;
    margin: 12% auto;
    padding: 28px;
    border-radius: 12px;
    width: 420px;
    max-width: 90%;
    position: relative;
    border: 1px solid #30363d;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.close {
    color: #484f58;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 18px;
    top: 14px;
    transition: color 0.2s ease;
}

.close:hover {
    color: #e1e4e8;
}

.modal h3 {
    margin-top: 0;
    color: #e1e4e8;
    font-weight: 600;
}

.modal p {
    color: #8b949e;
}

.modal label {
    color: #8b949e;
    font-weight: 600;
    font-size: 0.9em;
    display: block;
    margin-bottom: 6px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

.cancel-btn {
    background: #21262d;
    color: #e1e4e8;
    border: 1px solid #30363d;
}

.cancel-btn:hover {
    background: #30363d;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #484f58;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #8b949e;
}

/* Status indicators */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-active {
    background: rgba(35, 134, 54, 0.15);
    color: #3fb950;
    border: 1px solid rgba(35, 134, 54, 0.3);
}

.status-expired {
    background: rgba(218, 54, 51, 0.15);
    color: #f85149;
    border: 1px solid rgba(218, 54, 51, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    #add-partner-form,
    #add-subscription-form {
        flex-direction: column;
        align-items: stretch;
    }

    #partner-name-input,
    #subscription-email-input,
    #custom-code-input,
    #partner-select {
        min-width: auto;
        margin-bottom: 8px;
    }

    .subscription-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .subscription-actions {
        align-self: flex-end;
        margin-left: 0;
    }

    .modal-content {
        width: 90%;
        margin: 10% auto;
    }
}

/* Radar assignment modal */
#radar-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px 0;
}

#radar-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #1c2128;
    border-radius: 6px;
    border: 1px solid #30363d;
    cursor: pointer;
    font-size: 0.88em;
    color: #e1e4e8;
    transition: background 0.15s ease, border-color 0.15s ease;
}

#radar-checkboxes label:hover {
    background: #21262d;
    border-color: #388bfd;
}

#radar-checkboxes label.checked {
    background: rgba(56, 139, 253, 0.1);
    border-color: #388bfd;
}

#radar-checkboxes .radar-id {
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    color: #79c0ff;
    font-size: 0.9em;
    min-width: 50px;
}

#radar-checkboxes .radar-desc {
    color: #8b949e;
    font-size: 0.9em;
}

.radar-count-badge {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    margin-right: 8px;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.select-radars-btn {
    background: #FF9800 !important;
    color: white !important;
    padding: 4px 12px;
    font-size: 0.8em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 8px;
    transition: background 0.2s ease;
}

.select-radars-btn:hover {
    background: #F57C00 !important;
}

/* Animation for new items */
.subscription-item.new-item {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
