@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

:root {
    --bg-color: #1a1a1d;
    --primary-color: #c3073f;
    --secondary-color: #6f2232;
    --text-color: #f5f5f5;
    --control-bg: rgba(40, 40, 45, 0.8);
    
    /* Font size variables - much smaller default sizes */
    --font-scale: 1;
    --base-font-size: 0.7rem;
    --header-font-size: 1rem;
    --label-font-size: 0.75rem;
    --button-font-size: 0.65rem;
    --spacing-scale: 1;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#visualizer-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

/* Fallback styling for browsers that don't support video */
#visualizer-bg div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.app-container {
    /* Removed - no longer needed for minimal interface */
    display: none;
}

/* Start Button Container - Centered on screen */
#start-button-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#start-button-container::before {
    content: "Lullscape";
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#start-button-container::after {
    content: "Lull yourself to sleep. Craft your soundscape. \A Where tranquil sounds meet immersive environments.";
    white-space: pre-wrap;
    display: block;
    font-size: 1.2rem;
    color: rgba(245, 245, 245, 0.8);
    margin-top: 2rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#start-btn {
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-color);
    padding: 1rem 2rem;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#start-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

#controls {
    display: flex;
    flex-direction: column;
    gap: calc(0.8rem * var(--spacing-scale));
    position: relative;
    z-index: 1;
}

.slider-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: calc(0.75rem * var(--spacing-scale));
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.slider-group:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.slider-group label {
    font-size: calc(var(--label-font-size) * var(--font-scale));
    font-weight: 400;
    margin-bottom: calc(0.6rem * var(--spacing-scale));
    color: var(--text-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider:hover {
    background: rgba(255, 255, 255, 0.2);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 1);
}

.slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.background-selector, .presets {
    text-align: left;
    padding: calc(0.75rem * var(--spacing-scale));
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.background-selector:hover, .presets:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.background-selector label, .presets label {
    display: block;
    font-size: calc(var(--label-font-size) * var(--font-scale));
    font-weight: 400;
    margin-bottom: calc(0.6rem * var(--spacing-scale));
    color: var(--text-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.options {
    display: flex;
    gap: calc(0.6rem * var(--spacing-scale));
    flex-wrap: wrap;
}

button {
    padding: calc(0.5rem * var(--spacing-scale)) calc(1rem * var(--spacing-scale));
    font-size: calc(var(--button-font-size) * var(--font-scale));
    font-weight: bold;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Special styling for preset and background buttons */
.preset-btn, .background-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.preset-btn:hover, .background-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.35);
}

/* Settings Cog Button */
.settings-cog-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: none; /* Hidden initially */
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.settings-cog-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.settings-cog-btn svg {
    transition: transform 0.3s ease;
}

/* Buy Me a Coffee Widget Styling */
.bmc-widget-container {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 10;
    display: none; /* Hidden initially */
    transition: all 0.3s ease;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 4px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1);
}

.bmc-widget-container:hover {
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
}

/* Override BMC widget styles with glassmorphism */
.bmc-widget-container .bmc-button {
    background: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border: none !important;
    border-radius: 46px !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    padding: 0.6rem 1rem !important;
    min-width: auto !important;
    height: auto !important;
}

.bmc-widget-container .bmc-button:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    transform: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.bmc-widget-container .bmc-button img {
    width: 20px !important;
    height: 20px !important;
    margin-right: 0.5rem !important;
    transition: transform 0.3s ease !important;
}

.bmc-widget-container .bmc-button:hover img {
    transform: scale(1.1) !important;
}

/* Remove any default BMC styling that conflicts */
.bmc-widget-container .bmc-button .bmc-btn-text {
    color: #f5f5f5 !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: calc(1.5rem * var(--spacing-scale));
    width: 90%;
    max-width: calc(450px * var(--spacing-scale));
    max-height: none;
    overflow: visible;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.8) translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Glass morphism inner glow effect */
.modal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.08) 50%, 
        rgba(255, 255, 255, 0.05) 100%);
    border-radius: inherit;
    pointer-events: none;
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: calc(1rem * var(--spacing-scale));
    padding-bottom: calc(0.75rem * var(--spacing-scale));
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    z-index: 1;
}

.modal-header h2 {
    color: var(--text-color);
    font-size: calc(var(--header-font-size) * var(--font-scale));
    font-weight: 400;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.font-size-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0.3rem;
}

.font-size-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: bold;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.font-size-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.font-size-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
}

.font-size-btn.small {
    font-size: 0.8rem;
}

.font-size-btn.large {
    font-size: 1.2rem;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-color);
    font-size: calc(1.4rem * var(--font-scale));
    cursor: pointer;
    padding: 0;
    width: calc(36px * var(--font-scale));
    height: calc(36px * var(--font-scale));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Toggle Setting Styles */
.setting-group {
    padding: calc(1rem * var(--font-scale));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    color: var(--text-color);
    font-size: calc(0.9rem * var(--font-scale));
    font-weight: 500;
}

.toggle-text {
    flex: 1;
}

.toggle-container {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: 0.3s;
    border-radius: 24px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: rgba(255, 255, 255, 0.9);
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-slider {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.5);
}

.toggle-input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background: rgba(255, 255, 255, 1);
}

.subscription-badge {
    font-size: calc(0.75rem * var(--font-scale));
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    
    /* Default free tier styling */
    background: linear-gradient(135deg, rgba(128, 128, 128, 0.6), rgba(169, 169, 169, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
}

/* Tier-specific badge styling */
.subscription-badge.tier-meadow {
    background: linear-gradient(135deg, rgba(34, 139, 34, 0.8), rgba(50, 205, 50, 0.8));
    border: 1px solid rgba(144, 238, 144, 0.4);
    color: #90ee90;
}

.subscription-badge.tier-woodlands {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.8), rgba(160, 82, 45, 0.8));
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
}

.subscription-badge.tier-vista {
    background: linear-gradient(135deg, rgba(70, 130, 180, 0.8), rgba(100, 149, 237, 0.8));
    border: 1px solid rgba(135, 206, 250, 0.4);
    color: #87ceeb;
}

.subscription-badge.tier-summit {
    background: linear-gradient(135deg, rgba(128, 0, 128, 0.8), rgba(186, 85, 211, 0.8));
    border: 1px solid rgba(221, 160, 221, 0.4);
    color: #dda0dd;
}

.subscription-badge.visible {
    display: inline-block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Font size scaling classes */
.modal-container.large-font {
    --font-scale: 1.3;
    --spacing-scale: 1.15;
    max-width: calc(500px * var(--spacing-scale));
    max-height: none;
    overflow: visible;
}

/* Responsive Design */
@media (max-width: 768px) {
    #start-button-container::before {
        font-size: 2.5rem;
    }
    
    #start-button-container::after {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    #start-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .settings-cog-btn {
        top: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
    }
    
    .bmc-widget-container {
        top: 1.5rem;
        left: 1.5rem;
    }
    
    .bmc-widget-container .bmc-button {
        padding: 0.5rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
    
    .modal-container {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    #start-button-container::before {
        font-size: 2rem;
    }
    
    #start-button-container::after {
        font-size: 0.9rem;
    }
    
    .modal-container {
        max-height: 85vh;
    }
}