:root {
    --bg-color: #F5F7FA;
    --hero-gradient: linear-gradient(135deg, #243B55 0%, #4b6cb7 50%, #764ba2 100%);
    --primary-text: #2D3436;
    --accent-color: #FF6B6B;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    --font-main: 'Inter', sans-serif;
    --font-header: 'Orbitron', sans-serif;
}

/* Dark theme placeholder */
/* [data-theme="dark"] { } */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-color);
    font-family: var(--font-main);
    color: var(--primary-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Utilities */
.glass-panel {
    background: #FFFFFF;
    border: 1px solid #EAEAEA;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.glass-button {
    background: #FFFFFF;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    color: var(--primary-text);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.glass-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

.btn-accent {
    background: var(--accent-color);
    color: white;
}

.btn-accent:hover {
    background: #ff5252;
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6);
}

/* Layout */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px;
    width: 95%;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
}

.nav-brand {
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 700;
    color: #4b4b4b;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand i {
    color: #5f27cd;
}

.nav-links a {
    color: #636e72;
    text-decoration: none;
    margin-left: 30px;
    font-weight: 500;
}

/* Hero Section */
.hero {
    background: var(--hero-gradient);
    border-radius: 20px;
    padding: 80px 40px;
    text-align: center;
    color: white;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(36, 59, 85, 0.3);
}

.hero h1 {
    font-family: var(--font-main);
    font-weight: 800;
    font-size: 2.8rem;
    margin-bottom: 40px;
}

.search-container {
    max-width: 700px;
    margin: 0 auto 40px auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 20px 30px;
    border-radius: 50px;
    border: 2px solid transparent;
    /* Prepare for border change */
    font-size: 1.1rem;
    padding-right: 70px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    outline: none !important;
    /* Force remove default outline */
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.25);
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    height: 45px;
    width: 45px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
    z-index: 2;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
    /* Maintain vertical center */
    background-color: #ff5252;
}

/* Search Autocomplete */
.search-container {
    position: relative;
    /* Ensure dropdown is positioned relative to this */
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin-top: 10px;
    z-index: 100;
    overflow: hidden;
    display: none;
    /* Hidden by default */
    text-align: left;
}

.search-suggestions.show {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f2f6;
    transition: background 0.1s;
    color: #2d3436;
    text-decoration: none;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f8f9fa;
    color: var(--accent-color);
}

.suggestion-title {
    font-weight: 500;
    font-size: 0.95rem;
}

.suggestion-cat {
    font-size: 0.75rem;
    color: #b2bec3;
    background: #f1f2f6;
    padding: 2px 6px;
    border-radius: 4px;
}

.trending-cats {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.trending-label {
    display: block;
    margin-bottom: 15px;
    font-weight: 500;
    opacity: 0.9;
}

/* Main Layout (Sidebar + Grid) */
.page-layout {
    display: flex;
    gap: 40px;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.sidebar-title {
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--primary-text);
}

.filter-group {
    margin-bottom: 30px;
}

.filter-label {
    font-size: 0.8rem;
    color: #b2bec3;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.filter-list {
    list-style: none;
}

.filter-list li {
    margin-bottom: 10px;
}

.filter-btn {
    display: block;
    padding: 10px 0;
    color: #636e72;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.filter-btn:hover,
.filter-btn.active {
    color: var(--primary-text);
    font-weight: 700;
}

.filter-btn.active-pill {
    background: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

/* Content Area */
.content-area {
    flex-grow: 1;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: #2d3436;
}

.ringtone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.ringtone-card {
    padding: 20px;
    transition: transform 0.3s ease;
    border: none;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.card-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.ringtone-cover {
    width: 95px;
    min-width: 95px;
    /* Prevent squishing on mobile */
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    /* More rounded for modern look */
    border: 1px solid #f1f2f6;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.card-info {
    flex-grow: 1;
    min-width: 0;
}

.ringtone-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.card-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 5px;
    color: #2d3436;
}

.card-category {
    font-size: 0.75rem;
    color: #b2bec3;
    margin-bottom: 15px;
}

.audio-player-custom {
    background: #f1f2f6;
    border-radius: 50px;
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.play-circle {
    width: 40px;
    height: 30px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    padding-left: 3px;
    /* Visual optical adjustment for the triangle icon */
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.play-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.6);
}

.seek-slider {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.seek-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
    border: none;
    box-shadow: none;
}

.seek-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: none;
}

.seek-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: none;
}

.seek-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 8px;
    /* Reduced gap to fit */
    flex-wrap: wrap;
    /* Allow wrap on very small screens */
}

/* Store Badge Style */
.btn-dual-container {
    display: flex;
    gap: 6px;
    width: 100%;
    /* Take full width if needed */
    justify-content: flex-end;
    /* Align right or spread */
}

.store-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    /* Pill-ish but rect usually for store badges, user showed rounded pills */
    border-radius: 50px;
    text-decoration: none;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s, box-shadow 0.2s;
    /* Typography */
    font-size: 0.75rem;
    font-weight: 600;
    color: #2d3436;
    letter-spacing: -0.2px;
}

.store-btn i {
    font-size: 1.1rem;
}

/* Brand Colors for Icons Only */
.store-btn.android i {
    color: #3DDC84;
    /* Android Green */
}

.store-btn.iphone i {
    color: #000000;
    /* Apple Black */
}

.store-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d1d1d1;
}

.action-btn {
    flex: none;
    /* Reset flex */
    font-size: 0.85rem;
    color: #636e72;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.action-btn:hover {
    color: var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 10px;
    }

    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .nav-links {
        width: 100%;
        display: flex;
        justify-content: space-between;
        margin-left: 0;
    }

    .nav-links a {
        margin-left: 0;
        font-size: 0.9rem;
    }

    .page-layout {
        flex-direction: column;
        gap: 20px;
    }

    .sidebar {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 10px;
        border-bottom: 1px solid #f1f2f6;
        margin-bottom: 10px;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar::-webkit-scrollbar {
        height: 4px;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 4px;
    }

    .filter-group {
        display: inline-flex;
        align-items: center;
        margin-bottom: 0;
    }

    .filter-label {
        margin-bottom: 0;
        margin-right: 15px;
        display: none;
        /* Hide label on mobile to save space */
    }

    .filter-list {
        display: flex;
        gap: 8px;
    }

    .filter-btn {
        background: #f1f2f6;
        padding: 6px 14px;
        border-radius: 50px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .filter-btn.active-pill {
        background: var(--accent-color);
        box-shadow: none;
    }

    .hero {
        padding: 30px 20px;
        margin-bottom: 20px;
        border-radius: 12px;
    }

    .hero h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .search-input {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .search-btn {
        height: 38px;
        width: 38px;
    }

    /* Search Focused State (New Mobile UX) */
    .hero.search-focused h1,
    .hero.search-focused p,
    .hero.search-focused .trending-box,
    .official-badge {
        display: none !important;
    }

    .hero.search-focused {
        padding-top: 20px;
        padding-bottom: 20px;
        margin-bottom: 10px;
    }

    /* Modern Mobile Grid: 2 Columns */
    .ringtone-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .ringtone-card {
        padding: 12px;
        display: flex;
        flex-direction: column;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        border-radius: 12px;
    }

    /* Stack Header Elements */
    .card-header-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
        margin-bottom: 8px;
    }

    .ringtone-cover {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
        border-radius: 8px;
        margin-bottom: 0;
    }

    .card-info {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .card-title {
        font-size: 0.9rem;
        margin-bottom: 4px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        height: 2.6em;
        /* Fixed height for alignment */
    }

    .card-category {
        font-size: 0.7rem;
        margin-bottom: 8px;
    }

    /* Compact Audio Player */
    .audio-player-custom {
        padding: 4px;
        margin-bottom: 8px;
        background: #f8f9fa;
    }

    .play-circle {
        width: 35px;
        height: 25px;
        font-size: 0.7rem;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important;
    }

    /* Compact Actions */
    .card-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: auto;
    }

    .action-btn {
        display: none;
        /* Hide Like button on mobile to save space */
    }

    /* Alternative: Show Like Icon Only absolutely positioned? */
    /* Mini Action Button (Like button in header) */
    .action-btn-mini {
        background: none;
        border: 1px solid #dfe6e9;
        border-radius: 6px;
        padding: 2px 6px;
        font-size: 0.75rem;
        cursor: pointer;
        color: #636e72;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin-left: 8px;
        transition: 0.2s;
    }

    .action-btn-mini:hover {
        background: #ffeaa7;
        border-color: #ffeaa7;
        color: #d63031;
    }

    .action-btn-mini i {
        font-size: 0.8rem;
        color: #ff7675;
    }

    /* Let's just stack downloads for now */

    .btn-dual-container {
        gap: 5px;
    }

    .store-btn {
        padding: 6px 4px;
        font-size: 0.7rem;
        flex: 1;
        justify-content: center;
        border-radius: 6px;
    }

    .store-btn span {
        display: none;
        /* Hide text "Android/iPhone" to fit buttons side-by-side */
    }

    .store-btn i {
        font-size: 1.1rem;
        margin: 0;
    }

    /* Show text if specific class allows, but default hide for space */
    /* Actually, user might want text. Let's try to keep text but smaller font? */
    /* 2 columns means ~170px width. Buttons side by side ~80px. */
    /* "Android" word is ~40px. Icons ~15px. Padding 10px. It fits tightly. */

    .store-btn span {
        display: inline;
    }

}

/* Pagination */
.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-btn {
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    background: white;
    color: #636e72;
    font-weight: 600;
    transition: 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.page-btn:hover {
    background: #f1f2f6;
    color: var(--primary-text);
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

.page-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

@media (max-width: 768px) {
    .pagination {
        gap: 5px;
        margin-top: 20px;
    }

    .page-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}