/* Layout styles */

/* Header */
.header {
    padding: 20px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.header h1 {
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    color: var(--md-sys-color-on-surface);
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Main Container */
.main-container {
    padding: 0 20px 100px;
    max-width: 100%;
    margin: 0 auto;
}

/* Cards Container */
.cards-container {
    position: relative;
    padding: 40px 0;
    overflow: visible;
}

.cards-wrapper {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    padding: 20px 10px 30px 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin: 0 -10px;
}

.cards-wrapper::-webkit-scrollbar {
    display: none;
}

/* Bottom Controls */
.bottom-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, var(--md-sys-color-background) 60%, transparent);
    padding: 20px;
    z-index: 100;
}

.controls-wrapper {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 15px;
    align-items: center;
}

.volume-control {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--md-sys-color-surface-container);
    padding: 10px 15px;
    border-radius: 20px;
}

.volume-icon {
    font-size: 1.2rem;
    color: var(--md-sys-color-primary);
}

.volume-slider {
    flex: 1;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--md-sys-color-outline-variant);
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--md-sys-color-primary);
}

/* Swipe Indicator */
.swipe-indicator {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--md-sys-color-outline);
    font-size: 0.8rem;
    opacity: 0.7;
    animation: swipeHint 2s infinite;
}

/* Desktop and tablet - override mobile padding */
@media (min-width: 769px) {
    .cards-wrapper {
        padding: 20px 20px; /* Normal padding for desktop */
        scroll-snap-type: x proximity; /* Less aggressive snapping on desktop */
    }
    
    /* Reset margins on desktop */
    .frequency-card:first-child {
        margin-left: 0;
    }
    
    .add-card:last-child {
        margin-right: 0;
    }
}

/* Base mobile styles - applies to all mobile devices */
@media (max-width: 768px) {
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .main-container {
        padding: 0 10px 150px;
    }
    
    .cards-container {
        padding: 20px 0;
        overflow: hidden;
    }
    
    /* Universal mobile card wrapper */
    .cards-wrapper {
        display: flex;
        gap: 20px;
        padding: 0;
        align-items: center;
        min-height: 500px;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }
    
    .cards-wrapper::-webkit-scrollbar {
        display: none;
    }
    
    /* Default card sizing */
    .frequency-card, .add-card {
        scroll-snap-align: center;
        flex-shrink: 0;
    }
    
    /* Pseudo elements for centering space */
    .cards-wrapper::before,
    .cards-wrapper::after {
        content: '';
        flex-shrink: 0;
    }
    
    .bottom-controls {
        padding: 12px;
        background: var(--md-sys-color-background);
    }
    
    .controls-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    
    .volume-control {
        width: 100%;
    }
}

/* Large mobile / Small tablet (579px - 768px) */
@media (min-width: 579px) and (max-width: 768px) {
    .frequency-card, .add-card {
        flex: 0 0 70vw;
        min-width: 70vw;
        max-width: 70vw;
    }
    
    .cards-wrapper::before,
    .cards-wrapper::after {
        flex: 0 0 15vw;
        min-width: 15vw;
    }
}

/* Medium mobile (401px - 600px) - specific centering fix */
@media (min-width: 401px) and (max-width: 600px) {
    .cards-wrapper {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding: 0;
        scroll-padding: 0;
    }
    
    .frequency-card, .add-card {
        flex: 0 0 80vw !important;
        min-width: 80vw !important;
        max-width: 80vw !important;
        scroll-snap-align: center;
        margin: 0;
    }
    
    /* Centering spacers */
    .cards-wrapper::before,
    .cards-wrapper::after {
        content: '';
        flex: 0 0 10vw !important;
        min-width: 10vw !important;
        height: 1px;
    }
}

/* Small mobile (up to 400px) */
@media (max-width: 400px) {
    .cards-wrapper {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding: 0;
        scroll-padding: 0;
    }
    
    .frequency-card, .add-card {
        flex: 0 0 calc(100vw - 30px) !important;
        min-width: calc(100vw - 30px) !important;
        max-width: calc(100vw - 30px) !important;
        scroll-snap-align: center;
        margin: 0 5px;
    }
    
    /* Smaller spacers since cards are wider */
    .cards-wrapper::before,
    .cards-wrapper::after {
        content: '';
        flex: 0 0 15px !important;
        min-width: 15px !important;
        height: 1px;
    }
}

    /* Even smaller text on very small screens */
    .header h1 {
        font-size: 1.3rem;
    }
    
    .cards-wrapper {
        gap: 10px !important;
    }
}