<style>
/* --- 0. UNIVERSAL RESET & SCROLLBAR HIDING --- */
html, body, div, section, main, * {
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE 10+ */
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased; /* Crisp text */
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

:root {
    /* Refined Color Palette */
    --bg-deep: #050505;
    --bg-panel: #0a0a0a;
    --accent: #00FFBB; 
    --accent-glow: rgba(0, 255, 187, 0.4);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-dim: rgba(255, 255, 255, 0.08);
    --border-bright: rgba(255, 255, 255, 0.2);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-heavy: rgba(20, 20, 20, 0.75);
    --gold: #00FFBB; /* Kept your variable name */
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* --- 1. DESKTOP SIDEBAR (Left) --- */
.sidebar {
    width: 350px;
    /* Subtle noise texture simulation via gradient */
    background: linear-gradient(180deg, #0e0e0e 0%, #000000 100%);
    border-right: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    z-index: 10;
    box-shadow: 20px 0 60px rgba(0,0,0,0.5);
    position: relative;
}

.logo {
    display: none;
    color: var(--accent);
    margin-bottom: 3rem;
    font-weight: 900;
    letter-spacing: -1px;
    text-shadow: 0 0 20px var(--accent-glow);
}

.profile-list-container {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.profile-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0.5;
    border: 1px solid transparent;
    background: transparent;
}

/* Hover/Focus State - The "Glow" */
.profile-item.focused, .profile-item:hover {
    opacity: 1;
    transform: translateX(10px);
    background: var(--glass);
    border-color: var(--border-dim);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 10px; /* Softer square */
    background: linear-gradient(135deg, #333, #1a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
    border: 1px solid var(--border-dim);
}

.profile-item:hover .profile-avatar {
    transform: scale(1.1);
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.profile-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Edit Mode Animation */
.editing .profile-item {
    border-color: rgba(200, 50, 50, 0.5);
    animation: shake 0.4s ease-in-out infinite;
}

.delete-icon {
    display: none;
    color: #ff4444;
    margin-left: auto;
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px rgba(255, 68, 68, 0.5));
}
.editing .delete-icon { display: block; }

/* Buttons */
.action-buttons {
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-action {
    background: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-muted);
    padding: 14px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 3px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-action.focused, .btn-action:hover {
    border-color: var(--text-main);
    color: var(--bg-deep);
    background: var(--text-main);
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
}

/* --- 2. PREVIEW AREA (Right / Main) --- */
.preview-area {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    padding: 80px;
    overflow: hidden;
}

/* The Cinematic Background */
.preview-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Complex gradient for depth */
    background: radial-gradient(circle at 80% 20%, #1a1a1a 0%, #000000 60%);
    z-index: 1;
}

.spotlight {
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    /* Subtle moving light rays */
    background: conic-gradient(from 0deg at 50% 50%, transparent 0%, rgba(255, 255, 255, 0.03) 15%, transparent 30%);
    animation: rotateLight 30s linear infinite;
    z-index: 2;
    pointer-events: none;
}

.preview-content {
    z-index: 10;
    max-width: 900px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.preview-content.active {
    opacity: 1;
    transform: translateY(0);
}

/* Typography in Preview */
.meta-tag {
    display: none;
    color: var(--accent);
    font-size: 0.9rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 700;
}

.meta-tag::before {
    content: '';
    width: 30px;
    height: 1px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    display: none;
}

.surah-title-en {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    /* Gradient Text */
    background: linear-gradient(180deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.8));
}

.surah-title-ar {
    font-family: 'Amiri', serif;
    font-size: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    opacity: 0.6;
}

.surah-desc {
    font-size: 1.25rem;
    line-height: 1.7;
    color: #ccc;
    max-width: 650px;
    border-left: 3px solid var(--accent);
    padding-left: 25px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    padding-top: 10px;
    padding-bottom: 10px;
}

/* --- 3. UI OVERLAY & INPUTS --- */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px); /* Heavy Blur */
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.overlay.active { opacity: 1; pointer-events: all; }

input[type="text"] {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--text-muted);
    color: white;
    font-size: 3rem;
    text-align: center;
    width: 100%;
    padding: 15px;
    outline: none;
    font-weight: 300;
    transition: border-color 0.3s;
}
input[type="text"]:focus { border-color: var(--accent); }

/* --- 4. MODALS --- */
.modal {
    background: #151515;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border-dim);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}
.modal h3 { margin-top: 0; color: var(--accent); }
.btn-modal { padding: 12px 35px; border-radius: 6px; border: none; font-weight: bold; cursor: pointer; transition: 0.2s;}
.btn-yes { background: var(--accent); color: #000; box-shadow: 0 0 15px var(--accent-glow);}
.btn-no { background: #333; color: white; }

/* --- ANIMATIONS --- */
@keyframes rotateLight {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px) rotate(-1deg); }
    75% { transform: translateX(2px) rotate(1deg); }
}

/* --- 5. MOBILE & TABLET OPTIMIZATION (THE BIG FIX) --- */
@media screen and (max-width: 768px), screen and (orientation: portrait) {

    /* Body Lock */
    body {
        flex-direction: column;
        height: 100vh;
        width: 100vw;
        overflow-x: hidden;
        background: #000;
    }

    /* THE DYNAMIC ISLAND (Sidebar Refactored) */
    .sidebar {
        /* Floating Positioning */
        position: fixed;
        top: 15px;
        left: 50%;
        transform: translateX(-50%);
        
        /* Shape & Size */
        width: 92%; 
        max-width: 400px; 
        height: auto;
        padding: 8px 10px;
        
        /* Glassmorphism Polish */
        background: rgba(25, 25, 25, 0.85);
        backdrop-filter: blur(25px) saturate(180%);
        -webkit-backdrop-filter: blur(25px) saturate(180%);
        
        /* Borders & Depth */
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 40px;
        box-shadow: 
            0 15px 40px rgba(0, 0, 0, 0.5), /* Deep shadow */
            inset 0 1px 1px rgba(255, 255, 255, 0.2); /* Top highlight */
            
        /* Layout */
        display: flex;
        flex-direction: row; /* Horizontal flow */
        align-items: center;
        justify-content: center;
        z-index: 9999;
        
        /* Entrance Animation */
        animation: islandPop 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    }

    .logo { display: none; }

    /* Horizontal Scroll Strip */
    .profile-list-container {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 12px;
        width: 100%;
        overflow-x: auto;
        padding: 5px;
        justify-content: flex-start;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    }

    .profile-item {
        flex: 0 0 auto;
        width: auto; /* Allow natural width */
        min-width: 60px;
        flex-direction: column;
        gap: 6px;
        opacity: 0; /* For animation */
        padding: 0;
        margin: 0;
        animation: avatarSlide 0.5s ease-out forwards;
    }
    
    /* Stagger Animations */
    .profile-item:nth-child(1) { animation-delay: 0.1s; }
    .profile-item:nth-child(2) { animation-delay: 0.2s; }
    .profile-item:nth-child(3) { animation-delay: 0.3s; }
    .profile-item:nth-child(4) { animation-delay: 0.4s; }
    .profile-item:nth-child(5) { animation-delay: 0.5s; }

    .profile-item:hover, .profile-item.focused {
        background: transparent;
        box-shadow: none;
        transform: none;
    }

    .profile-avatar {
        width: 48px; 
        height: 48px;
        border-radius: 50%; /* Circle on mobile */
        border: 2px solid transparent;
        background: #2a2a2a;
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    }
    
    .profile-item.active .profile-avatar {
        border-color: var(--accent);
        box-shadow: 0 0 12px var(--accent-glow);
    }

    .profile-name {
        font-size: 0.65rem;
        color: #aaa;
        max-width: 60px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Elements to hide on Mobile */
    .profile-status, .action-buttons, .btn-action, .surah-title-en, .surah-title-ar, .surah-desc, .meta-tag {
        display: none !important;
    }

    /* Preview Area Adjustments */
    .preview-area {
        padding: 160px 20px 40px 20px; /* Space for Island */
        align-items: flex-start;
        overflow-y: auto;
    }
    
    .preview-bg {
        background: radial-gradient(circle at 50% 50%, #1a1a1a 0%, #000 90%);
        position: fixed;
    }

    .input-box {
        margin-top: 20px;
        width: 100%;
    }
    
    /* Mobile Animation Keyframes */
    @keyframes islandPop {
        0% { opacity: 0; transform: translate(-50%, -150%) scale(0.9); }
        100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    }
    
    @keyframes avatarSlide {
        0% { opacity: 0; transform: translateX(10px); }
        100% { opacity: 1; transform: translateX(0); }
    }
}
</style>
