* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-panel {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.frequency-control {
    margin-bottom: 30px;
}

.frequency-control h2 {
    color: #4a5568;
    margin-bottom: 20px;
    text-align: center;
}

.frequency-slider {
    text-align: center;
}

.frequency-slider label {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2d3748;
}

#frequency-display {
    color: #667eea;
    font-size: 1.5rem;
}

#frequency {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e2e8f0;
    outline: none;
    margin-bottom: 15px;
}

#frequency::-webkit-slider-thumb {
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.frequency-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #718096;
}

.preset-modes {
    margin-bottom: 30px;
}

.preset-modes h2 {
    color: #4a5568;
    margin-bottom: 20px;
    text-align: center;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.preset-btn {
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #f7fafc;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: center;
}

.preset-btn:hover {
    border-color: #667eea;
    background: #edf2f7;
    transform: translateY(-2px);
}

.preset-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.control-panel {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.control-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.control-btn.primary {
    background: #48bb78;
    color: white;
}

.control-btn.primary:hover {
    background: #38a169;
}

.control-btn:not(.primary) {
    background: #e2e8f0;
    color: #4a5568;
}

.control-btn:not(.primary):hover:not(:disabled) {
    background: #cbd5e0;
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.volume-control {
    margin-bottom: 30px;
    text-align: center;
}

.volume-control label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #4a5568;
}

#volume-display {
    color: #667eea;
}

#volume {
    width: 100%;
    max-width: 300px;
    margin-bottom: 5px;
}

.status-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
}

.status-item {
    text-align: center;
}

.status-label {
    display: block;
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 5px;
}

.status-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2d3748;
}

.advanced-settings {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.advanced-settings h3 {
    color: #4a5568;
    margin-bottom: 15px;
}

.setting-row {
    margin-bottom: 15px;
}

.setting-row label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4a5568;
}

.setting-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.setting-row select {
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    background: white;
}

.info-panel {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.info-panel h3 {
    color: #4a5568;
    margin-bottom: 15px;
}

.info-panel ul {
    list-style: none;
    margin-bottom: 15px;
}

.info-panel li {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.info-panel li:last-child {
    border-bottom: none;
}

.info-panel strong {
    color: #667eea;
}

.background-audio {
    margin-bottom: 30px;
}

.background-audio h3 {
    color: #4a5568;
    margin-bottom: 15px;
    text-align: center;
}

.audio-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.audio-btn {
    padding: 12px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f7fafc;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-align: center;
}

.audio-btn:hover {
    border-color: #667eea;
    background: #edf2f7;
    transform: translateY(-1px);
}

.audio-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.volume-controls {
    margin-bottom: 30px;
}

.volume-controls .volume-control {
    margin-bottom: 15px;
}

/* 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);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
}

.modal.show {
    opacity: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    margin: 20px 0;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.modal-content::-webkit-scrollbar {
    display: none;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 30px 30px 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.8rem;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close:hover {
    color: #e74c3c;
    background: #f8f9fa;
}

.modal-body {
    padding: 30px;
}

/* Custom Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
    line-height: 1.4;
    margin-bottom: 15px;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #3498db;
    border-color: #3498db;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.terms-checkbox, .marketing-checkbox {
    margin: 15px 0;
}

.terms-checkbox a, .marketing-checkbox a {
    color: #3498db;
    text-decoration: none;
}

.terms-checkbox a:hover, .marketing-checkbox a:hover {
    text-decoration: underline;
}

.submit-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.submit-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

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

/* Responsive Modal */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
        justify-content: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
    }
    
    .modal-content {
        max-height: 95vh;
        margin: 0;
        border-radius: 12px;
    }
    
    .modal-header, .modal-body {
        padding: 20px 15px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group.half {
        margin-bottom: 20px;
    }
}

/* User Info & Dropdown Styles */
#user-info {
    position: relative;
    display: inline-block;
    z-index: 1000;
    color: white;
    min-height: 40px; /* Ensure minimum height to prevent layout shift */
}

/* Ensure all text in the header is white */
header a, 
header .pricing-link, 
header .start-trial-link,
header .user-name,
header .user-status,
header .user-dropdown a {
    color: white !important;
    text-decoration: none;
    margin-left: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

header a:hover, 
header .pricing-link:hover, 
header .start-trial-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.user-details {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-details:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    font-size: 16px;
}

.user-info {
    display: flex;
    flex-direction: column;
    margin-right: 8px;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

.user-status {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 2px;
}

.user-status.trial-active {
    color: #f6e05e;
}

.dropdown-arrow {
    font-size: 0.6rem;
    opacity: 0.7;
    color: white;
    transition: transform 0.2s ease;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1001;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-section {
    padding: 12px 0;
    border-bottom: 1px solid #edf2f7;
}

.dropdown-section:last-child {
    border-bottom: none;
}

.dropdown-header {
    padding: 8px 16px 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #718096;
    letter-spacing: 0.05em;
}

.dropdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    color: #4a5568;
    text-decoration: none;
    transition: background 0.2s ease;
    font-size: 0.875rem;
    line-height: 1.4;
}

.dropdown-item:hover {
    background: #f7fafc;
}

.dropdown-item .label {
    font-weight: 500;
    color: #4a5568;
    margin-right: 8px;
    white-space: nowrap;
}

.dropdown-item .value {
    color: #4a5568;
    text-align: right;
    word-break: break-word;
    flex: 1;
}

/* Account details section */
.dropdown-section.account-details {
    padding: 8px 0;
}

.dropdown-section.account-details .dropdown-item {
    padding: 6px 16px;
}

.plan-info {
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 12px !important;
    margin-bottom: 4px;
}

.trial-countdown {
    display: inline-block;
    background: #f6e05e;
    color: #744210;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 600;
}

/* Subscription Banner */
.subscription-banner {
    background: rgba(0, 0, 0, 0.4);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    color: white !important; /* Force white text */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

/* Upgrade Banner - Shown when trial has ended */
.subscription-banner.upgrade-banner {
    background: linear-gradient(135deg, #ff4d4d 0%, #ff8a80 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(255, 77, 77, 0.3);
}

.subscription-banner * {
    color: white !important;
}

.subscription-banner .status-message {
    font-size: 1rem;
    font-weight: 500;
    margin-right: 15px;
    color: white !important;
}

/* Upgrade Button */
.upgrade-button {
    background-color: white !important;
    color: #ff4d4d !important;
    padding: 8px 20px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 14px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    display: inline-block !important;
}

.upgrade-button:hover {
    background-color: #fff !important;
    color: #e60000 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

/* Upgrade Section in Dropdown */
.dropdown-section.upgrade-section {
    background-color: #fff8f8;
    border-left: 4px solid #ff4d4d;
    margin: 5px 0;
    border-radius: 0 8px 8px 0;
}

.dropdown-section.upgrade-section .dropdown-header {
    color: #ff4d4d !important;
    font-weight: 600;
}

.dropdown-section.upgrade-section .upgrade-text {
    color: #666 !important;
    font-size: 0.85rem;
    margin: 5px 0 10px;
    line-height: 1.4;
}

/* Status Indicators */
.user-status.trial-expired {
    color: #ff4d4d !important;
    font-weight: 600;
}

.user-status.premium-member {
    color: #4CAF50 !important;
    font-weight: 600;
}

/* Upgrade Badge in Dropdown */
.upgrade-badge {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white !important;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

/* Highlight upgrade option in dropdown */
#upgrade-account {
    background-color: #f0f9f0;
    border-left: 3px solid #4CAF50;
    margin: 5px 0;
    border-radius: 0 8px 8px 0;
}

#upgrade-account .label {
    color: #2e7d32 !important;
    font-weight: 600;
}

#upgrade-account:hover {
    background-color: #e0f2e0;
}

/* Subscribe Button Styles */
.subscribe-button {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    color: white !important;
    border: none !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
    letter-spacing: 0.5px !important;
}

.subscribe-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15) !important;
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%) !important;
}

/* Plan Button Container */
.plan-button-container {
    margin-top: 20px;
    text-align: center;
}

.trial-info {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.trial-countdown-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white !important;
}

.countdown-label {
    font-weight: 500;
    color: white !important;
}

.countdown-timer {
    font-weight: 600;
    color: #4fd1c5 !important; /* Slightly different color for the timer */
}

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

.title-section {
    text-align: left;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .main-panel {
        padding: 20px;
    }
    
    .preset-buttons {
        grid-template-columns: 1fr;
    }
    
    .control-panel {
        flex-direction: column;
        align-items: center;
    }
    
    .status-display {
        grid-template-columns: 1fr;
    }
    
    .audio-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .user-dropdown {
        width: calc(100vw - 40px);
        right: 10px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .title-section {
        text-align: center;
        width: 100%;
    }
    
    #user-info {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .user-details {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}
