@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #050505;
    --primary: #c29b62; 
    --primary-glow: rgba(194, 155, 98, 0.4);
    --secondary: #2563eb;
    --text-main: #ffffff;
    --text-muted: #8a8f98;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) var(--bg-dark);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ================= CUSTOM SCROLLBAR ================= */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    border: 3px solid var(--bg-dark);
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ================= BACKGROUND ORBS FOR VIBRANT HI-FI FEEL ================= */
body::before, body::after, .bg-orb-3 {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.4;
    animation: floatOrb 25s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

body::before {
    width: 60vw; height: 60vw;
    background: #7928ca; /* Deep Purple */
    top: -20%; left: -10%;
}

body::after {
    width: 50vw; height: 50vw;
    background: #ff0080; /* Vibrant Pink */
    bottom: -15%; right: -15%;
    animation-delay: -5s;
}

.bg-orb-3 {
    width: 45vw; height: 45vw;
    background: #00f2fe; /* Neon Cyan */
    top: 30%; left: 20%;
    animation-delay: -12s;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(8%, 12%) scale(1.15); }
}

/* ================= GLASSMORPHISM SYSTEM ================= */
.glass-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-highlight);
    border-left: 1px solid var(--glass-highlight);
    border-radius: 24px;
    box-shadow: 
        0 30px 60px -10px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ================= ANIMATIONS ================= */
.fade-in { opacity: 0; animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.slide-up { opacity: 0; transform: translateY(30px); animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

@keyframes fadeIn { to { opacity: 1; } }
@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }

/* ================= HOME PAGE NO-SCROLL LAYOUT ================= */
.home-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Prevent scrolling entirely on desktop */
}

.home-page .header {
    padding: 0;
    margin-bottom: 2rem;
}

.home-page .container {
    padding: 0;
    width: 100%;
    max-width: 1100px;
}

.home-page .reciter-list {
    margin-top: 0;
    gap: 2rem;
}

@media (max-width: 768px) {
    .home-page {
        height: auto;
        min-height: 100vh;
        overflow: auto; /* Allow scrolling on mobile if cards stack */
        padding: 4rem 0;
    }
}

/* ================= HEADER ================= */
.header {
    text-align: center;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 10;
}

.top-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    z-index: 10;
}

.top-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-links a:hover {
    color: var(--text-main);
}

.logo, .profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.05);
    margin: 0 auto 1.5rem auto;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo:hover, .profile-image:hover {
    transform: scale(1.05) rotate(-5deg);
}

.header h1 {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #8a8f98 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ================= MAIN CONTENT ================= */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* ================= INDEX RECITER CARDS ================= */
.reciter-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.reciter-card {
    display: flex;
    align-items: center;
    padding: 2.5rem;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.reciter-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.reciter-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255,255,255,0.05);
}

.reciter-card:hover::after { opacity: 1; }

.reciter-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
    z-index: 2;
}

.reciter-number {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
    font-size: 1.5rem;
    color: var(--text-main);
    box-shadow: inset 0 0 20px rgba(255,255,255,0.02);
}

.reciter-name {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ================= SURAH LIST ================= */
.search-container {
    margin-bottom: 4rem;
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-input {
    width: 100%;
    padding: 1.5rem 2rem 1.5rem 3.5rem;
    font-size: 1.1rem;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 100px;
    color: var(--text-main);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.search-input:focus {
    outline: none;
    background: rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 0 30px rgba(255,255,255,0.05), inset 0 2px 4px rgba(0,0,0,0.5);
}

.search-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}

.surah-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
    padding-bottom: 150px; /* Space for audio player */
}

.surah-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.surah-card:hover {
    transform: translateY(-6px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.surah-card.active {
    border-color: rgba(255,255,255,0.4);
    background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent);
    box-shadow: 0 0 30px rgba(255,255,255,0.05);
}

.surah-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.surah-number {
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary);
    letter-spacing: 0.05em;
}

.surah-name {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.button-group {
    display: flex;
    gap: 0.8rem;
}

.btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 0.8rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.4s ease;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: translateY(-2px);
}

.btn-play { 
    background: var(--text-main); 
    color: var(--bg-dark); 
    border: none;
}
.btn-play:hover { 
    background: #e2e8f0; 
    color: var(--bg-dark);
    box-shadow: 0 10px 20px rgba(255,255,255,0.2);
}

/* ================= BIO SECTION ================= */
.bio-section {
    margin: 8rem auto;
    padding: 0 2rem;
    max-width: 1400px;
}

.bio-section h2 {
    color: var(--text-main);
    margin-bottom: 4rem;
    text-align: center;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.bio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.bio-card-inner {
    padding: 3rem;
    height: 100%;
}

.bio-card-inner h3 {
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.bio-card-inner p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

/* ================= AUDIO PLAYER (FIXED LAYOUT) ================= */
.audio-player {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translate(-50%, 150%);
    width: 95%;
    max-width: 900px;
    padding: 1.2rem 2.5rem;
    z-index: 1000;
    border-radius: 100px;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.audio-player.visible {
    transform: translate(-50%, 0);
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 25%;
    min-width: 200px;
    white-space: nowrap;
}

.now-playing-info {
    overflow: hidden;
}

.now-playing-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.1rem;
    text-overflow: ellipsis;
    overflow: hidden;
}

.now-playing-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-overflow: ellipsis;
    overflow: hidden;
}

.player-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    color: var(--text-main);
}

.play-pause-main {
    width: 48px;
    height: 48px;
    background: var(--text-main);
    color: var(--bg-dark);
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.play-pause-main:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(255,255,255,0.2);
}

.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
}

.time-display {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    min-width: 35px;
}

.progress-container {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-container:hover .progress-bar::after {
    opacity: 1;
    transform: scale(1);
}

.progress-bar {
    height: 100%;
    background: var(--text-main);
    width: 0;
    border-radius: 2px;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -6px;
    top: -4px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.player-options {
    width: 25%;
    min-width: 100px;
    display: flex;
    justify-content: flex-end;
}

.speed-control {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
}

.speed-control:hover {
    background: rgba(255,255,255,0.15);
}

.speed-control option {
    background: var(--bg-dark);
    color: var(--text-main);
}

/* ================= LOADING & NOTIFS ================= */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255,255,255,0.05);
    border-top-color: var(--text-main);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin-bottom: 2rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

#custom-notification {
    display: none;
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-main);
    padding: 1rem 2rem;
    border-radius: 100px;
    z-index: 10000;
    font-weight: 500;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1), slideOutRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) 2.5s forwards;
}
