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

:root {
    /* Light theme - Blue shades */
    --bg-primary: linear-gradient(135deg, #2196F3 0%, #1976D2 50%, #0D47A1 100%);
    --bg-card: #ffffff;
    --bg-card-hover: #f5f9ff;
    --bg-input: #ffffff;
    --bg-quote-card: #E3F2FD;
    --text-primary: #0D47A1;
    --text-secondary: #1565C0;
    --text-muted: #64B5F6;
    --text-white: #ffffff;
    --text-on-card: #1565C0;
    --text-body: #37474F;
    --border-color: #BBDEFB;
    --accent-primary: #2196F3;
    --accent-secondary: #42A5F5;
    --accent-hover: #1E88E5;
    --shadow-sm: 0 2px 8px rgba(33, 150, 243, 0.15);
    --shadow-md: 0 4px 12px rgba(33, 150, 243, 0.2);
    --shadow-lg: 0 8px 24px rgba(33, 150, 243, 0.25);
    --highlight-bg: #BBDEFB;
}

[data-theme="dark"] {
    /* Dark theme - Blue shades */
    --bg-primary: linear-gradient(135deg, #0D47A1 0%, #01579B 50%, #002171 100%);
    --bg-card: #1A237E;
    --bg-card-hover: #283593;
    --bg-input: #283593;
    --bg-quote-card: #1E2A5A;
    --text-primary: #90CAF9;
    --text-secondary: #64B5F6;
    --text-muted: #5C6BC0;
    --text-white: #E3F2FD;
    --text-on-card: #BBDEFB;
    --text-body: #B0BEC5;
    --border-color: #3949AB;
    --accent-primary: #42A5F5;
    --accent-secondary: #2196F3;
    --accent-hover: #64B5F6;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --highlight-bg: #3949AB;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-body);
    transition: background 0.3s ease, color 0.3s ease;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    color: var(--accent-primary);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: var(--shadow-lg);
    background: var(--bg-card-hover);
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: var(--text-white);
    margin-bottom: 40px;
    padding: 20px 0;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    color: var(--text-white);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    color: var(--text-white);
}

.search-section {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    position: relative;
    min-width: 250px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

#searchInput {
    width: 100%;
    padding: 16px 50px 16px 50px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background: var(--bg-input);
    color: var(--text-on-card);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    outline: none;
}

#searchInput::placeholder {
    color: var(--text-muted);
}

#searchInput:focus {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.clear-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: var(--bg-quote-card);
    color: var(--text-on-card);
}

.random-btn {
    padding: 16px 28px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.random-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.random-btn:active {
    transform: translateY(0);
}

.results-container {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    min-height: 300px;
    padding: 30px;
    transition: all 0.3s ease;
}

.welcome-message {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px;
    font-size: 1.1rem;
}

.quote-card {
    padding: 24px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: var(--bg-quote-card);
    border-left: 4px solid var(--accent-primary);
    transition: all 0.3s ease;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quote-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
    background: var(--bg-card-hover);
}

.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.surah-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.surah-name {
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 1.1rem;
}

.ayah-number {
    background: var(--accent-primary);
    color: var(--text-white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.quote-text {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-on-card);
    margin-bottom: 12px;
    direction: rtl;
    text-align: right;
}

.quote-translation {
    font-size: 0.95rem;
    color: var(--text-body);
    font-style: italic;
    line-height: 1.6;
    padding-left: 16px;
    border-left: 2px solid var(--border-color);
}

.stats {
    text-align: center;
    color: var(--text-white);
    margin-top: 20px;
    padding: 12px;
    font-size: 0.95rem;
    opacity: 0.9;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-on-card);
}

.highlight {
    background: var(--highlight-bg);
    padding: 2px 4px;
    border-radius: 3px;
    color: var(--text-on-card);
    font-weight: 600;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .search-section {
        flex-direction: column;
    }

    .random-btn {
        width: 100%;
        justify-content: center;
    }

    .results-container {
        padding: 20px;
    }

    .quote-card {
        padding: 16px;
    }

    .quote-text {
        font-size: 1.05rem;
    }

    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
    }
}
