:root {
    --primary-color: #6a5acd;
    --secondary-color: #f0f0f0;
    --text-color: #333;
    --background-color: #ffffff;
    --container-width: 1100px;
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 90, 205, 0.4);
}

.btn-secondary {
    background-color: #ccc;
    color: #333;
}

.hero {
    text-align: center;
    padding: 80px 0;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.subtitle {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 40px;
    opacity: 0.8;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.feature-card {
    background: var(--background-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: left;
}

.dashboard {
    text-align: center;
}

.preferences-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 40px;
    text-align: left;
}

.preference-card {
    background: var(--background-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.radio-option {
    display: block;
    background: #f9f9f9;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-option:hover {
    background: #e9e6ff;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--primary-color);
}

.actions {
    margin-top: 40px;
}

#confirmation-message {
    margin-top: 20px;
    color: var(--primary-color);
    font-weight: 600;
}

.main-footer {
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
    color: #888;
}

/* ============================================================================
   SUBSCRIPTION CARD STYLES
   ============================================================================ */

.subscription-card {
    margin-top: 16px;
}

.subscription-view {
    display: block;
}

.subscription-view.hidden {
    display: none;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-trial {
    background-color: #EFF6FF;
    color: #1E40AF;
}

.status-trial .status-dot {
    background-color: #3B82F6;
}

.status-active {
    background-color: #ECFDF5;
    color: #065F46;
}

.status-active .status-dot {
    background-color: #10B981;
}

.status-expired {
    background-color: #FEF2F2;
    color: #991B1B;
}

.status-expired .status-dot {
    background-color: #EF4444;
}

.status-warning {
    background-color: #FFFBEB;
    color: #92400E;
}

.status-warning .status-dot {
    background-color: #F59E0B;
}

.status-cancelled {
    background-color: #F3F4F6;
    color: #374151;
}

.status-cancelled .status-dot {
    background-color: #6B7280;
}

/* Subscription Details */
.subscription-details {
    margin: 1.5rem 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #E5E7EB;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #6B7280;
    font-size: 0.875rem;
}

.detail-value {
    font-weight: 600;
    color: #111827;
}

.trial-message,
.trial-info,
.expired-message,
.warning-message,
.cancelled-message {
    line-height: 1.6;
    color: #374151;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.trial-message strong,
.trial-info strong {
    color: #1E40AF;
}

/* Subscription Actions */
.subscription-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: #5a4cbe;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: white;
    color: #374151;
    border: 1px solid #D1D5DB;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: #F3F4F6;
}

/* Skeleton Loader */
.skeleton-loader {
    animation: pulse-skeleton 1.5s infinite;
}

@keyframes pulse-skeleton {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton-badge {
    width: 150px;
    height: 32px;
    background: linear-gradient(90deg, #E5E7EB 25%, #F3F4F6 50%, #E5E7EB 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.skeleton-text {
    width: 100%;
    height: 16px;
    background: linear-gradient(90deg, #E5E7EB 25%, #F3F4F6 50%, #E5E7EB 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin: 0.5rem 0;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Custom Dropdown Styles - Redesigned for better UX */
.custom-dropdown {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    padding: 0px 14px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s ease;
    min-height: 36px;
    font-weight: 500;
    box-sizing: border-box;
}

.custom-dropdown-trigger:hover {
    border-color: #9ca3af;
    background: #fafbfc;
}

.custom-dropdown-trigger.open {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(106, 90, 205, 0.1);
}

.custom-dropdown-trigger .trigger-text {
    flex: 1;
    min-width: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-dropdown-trigger .trigger-icon {
    flex-shrink: 0;
    margin-left: 10px;
    transition: transform 0.2s ease;
    color: #6b7280;
    font-size: 12px;
}

.custom-dropdown-trigger.open .trigger-icon {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: max-content;
    min-width: 100%;
    max-width: 380px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    max-height: 480px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: dropdownSlideIn 0.2s ease-out;
    box-sizing: border-box;
}

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

.custom-dropdown-menu.hidden {
    display: none;
}

.custom-dropdown-search {
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    position: sticky;
    top: 0;
    z-index: 1;
}

.custom-dropdown-search input {
    width: -webkit-fill-available;
    padding: 10px 16px 10px 42px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.15s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 16px center;
    background-color: white;
}

.custom-dropdown-search input::placeholder {
    color: #9ca3af;
}

.custom-dropdown-search input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 90, 205, 0.1);
}

.custom-dropdown-options {
    overflow-y: auto;
    max-height: 340px;
    padding: 8px 0;
}

.custom-dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-options::-webkit-scrollbar-track {
    background: transparent;
}

.custom-dropdown-options::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.custom-dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.custom-dropdown-option {
    padding: 8px 18px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: background 0.1s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.custom-dropdown-option:hover {
    background: #f9fafb;
}

.custom-dropdown-option.selected {
    background: #ede9fe;
    color: var(--primary-color);
    font-weight: 500;
}

.custom-dropdown-option .channel-icon {
    opacity: 0.7;
    font-size: 14px;
    min-width: 18px;
    text-align: center;
}

.custom-dropdown-option.selected .channel-icon {
    opacity: 1;
}

.custom-dropdown-loading {
    padding: 32px 24px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.custom-dropdown-loading .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.custom-dropdown-empty {
    padding: 32px 24px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
    line-height: 1.6;
}

.custom-dropdown-custom-section {
    border-top: 1px solid #e5e7eb;
    padding: 14px 16px;
    background: #f9fafb;
}

.custom-dropdown-custom-section .section-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 600;
}

.custom-dropdown-custom-section .input-group {
    display: flex;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.custom-dropdown-custom-section input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12.5px;
    outline: none;
    font-family: 'Monaco', 'Menlo', monospace;
    transition: all 0.15s ease;
    background: white;
    color: #374151;
    box-sizing: border-box;
}

.custom-dropdown-custom-section input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 90, 205, 0.1);
}

.custom-dropdown-custom-section input::placeholder {
    font-family: 'Poppins', sans-serif;
    color: #9ca3af;
}

.custom-dropdown-custom-section button {
    padding: 8px 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.custom-dropdown-custom-section button:hover:not(:disabled) {
    background: #5a4abd;
    transform: translateY(-1px);
}

.custom-dropdown-custom-section button:active:not(:disabled) {
    transform: translateY(0);
}

.custom-dropdown-custom-section button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-dropdown-custom-section .error-message {
    font-size: 12px;
    color: #dc2626;
    margin-top: 8px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    line-height: 1.4;
}

.custom-dropdown-custom-section .success-message {
    font-size: 12px;
    color: #059669;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    .preferences-grid {
        grid-template-columns: 1fr;
    }
    .subscription-actions {
        flex-direction: column;
    }
    .subscription-actions button {
        width: 100%;
    }
    
    .custom-dropdown-menu {
        max-height: 280px;
        width: calc(100vw - 32px);
        min-width: 280px;
        max-width: calc(100vw - 32px);
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    
    .custom-dropdown-options {
        max-height: 200px;
    }
    
    .custom-dropdown-search {
        padding: 12px 14px;
    }
    
    .custom-dropdown-search input {
        padding: 8px 12px 8px 36px;
        font-size: 13px;
    }
    
    .custom-dropdown-custom-section {
        padding: 12px 14px;
    }
    
    .custom-dropdown-custom-section input {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .custom-dropdown-custom-section button {
        padding: 8px 12px;
        font-size: 13px;
    }
}
