@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Amiri:wght@400;700&display=swap');

:root {
    --color-primary: #2563eb;
    /* Royal Blue */
    --color-primary-dark: #1d4ed8;
    --color-success: #10b981;
    /* Emerald */
    --color-danger: #ef4444;
    /* Red */
    --color-warning: #f59e0b;
    /* Amber */
    --color-text: #1e293b;
    /* Slate 800 */
    --color-text-muted: #64748b;
    /* Slate 500 */
    --bg-body: #f1f5f9;
    /* Slate 100 */
    --bg-white: #ffffff;
    --card-radius: 12px;
    --btn-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    background-color: var(--bg-body);
    font-family: 'Hilda', 'Ericsson Hilda', 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--color-text);
    line-height: 1.6;

    /* Dotted Pattern */
    background-image: radial-gradient(#cbd5e1 1.5px, transparent 1.5px);
    background-size: 24px 24px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: #0f172a;
    /* Slate 900 */
    letter-spacing: -0.025em;
}

.font-arabic {
    font-family: 'Amiri', serif;
    line-height: 1.8; /* Increased from default to prevent clipping */
}

/* Global override for large Arabic text to prevent clipping */
.font-arabic-large {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 3.5rem;
    line-height: 1.6 !important; /* Force sufficient height */
    padding-top: 0.2em; /* Add top space for tall glyphs like Hamza */
    padding-bottom: 0.1em;
    display: inline-block; /* Ensure padding works */
}

.text-muted {
    color: var(--color-text-muted) !important;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 700;
    color: var(--color-text);
}

.btn-outline-primary {
    border-color: #e2e8f0;
    color: var(--color-text);
    border-radius: var(--btn-radius);
}

.btn-outline-primary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: var(--color-text);
}

/* Cards */
.card {
    background: var(--bg-white);
    border: 1px solid #e2e8f0;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease-in-out;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

/* Card Background Tints based on Borders */
.card.border-primary-subtle {
    background-color: #f0f9ff;
}

/* Sky 50 */
.card.border-success-subtle {
    background-color: #f0fdf4;
}

/* Emerald 50 */
.card.border-danger-subtle {
    background-color: #fef2f2;
}

/* Red 50 */
.card.border-warning-subtle {
    background-color: #fffbeb;
}

/* Amber 50 */
.card.border-info-subtle {
    background-color: #ecfeff;
}

/* Cyan 50 */

/* Buttons */
.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    border-radius: var(--btn-radius);
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

.btn-success {
    background-color: var(--color-success);
    border-color: var(--color-success);
}

.btn-danger {
    background-color: var(--color-danger);
    border-color: var(--color-danger);
}

.btn-warning {
    background-color: var(--color-warning);
    border-color: var(--color-warning);
    color: white;
}

/* Book Cards Specifics */
.book-card {
    padding: 2.5rem;
    height: 100%;
}

.book-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

/* Map / Nodes */
.map-container {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
}

.lesson-node {
    width: 60px;
    height: 60px;
    background: white;
    border: 2px solid #e2e8f0;
    color: #94a3b8;
    border-radius: 12px;
    /* Soft square instead of circle */
}

/* Book Cover Styles */
.book-cover {
    aspect-ratio: 2/3;
    /* Vertical rectangular book shape */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    color: white;
    border: none;
    border-radius: 12px 24px 24px 12px;
    /* Subtle book spine curve */
    box-shadow:
        5px 5px 15px rgba(0, 0, 0, 0.1),
        inset 10px 0 20px rgba(0, 0, 0, 0.1);
    /* Spine shadow effect */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    position: relative;
}

.book-cover:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow:
        10px 15px 25px rgba(0, 0, 0, 0.2),
        inset 10px 0 20px rgba(0, 0, 0, 0.1);
}

/* Gradients */
.book-cover-blue {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.book-cover-green {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

.book-cover-red {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

.book-cover-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.book-cover-indigo {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
}

/* Inner Book Design Elements */
.book-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15px;
    /* Spine groove */
    bottom: 0;
    width: 2px;
    background: rgba(0, 0, 0, 0.2);
}

.book-cover .book-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    backdrop-filter: blur(5px);
}

.book-cover .btn-light-transparent {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    backdrop-filter: blur(5px);
}

.book-cover .btn-light-transparent:hover {
    background: white;
    color: var(--color-primary);
}

.lesson-node {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 10px;
    transition: all 0.2s;
}

.lesson-node.unlocked {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.lesson-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Badges */
.badge {
    padding: 0.5em 0.8em;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* Clean Lesson Sections */
.lesson-section {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
}

.word-card {
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc;
}

.word-card:hover {
    border-color: var(--color-primary) !important;
    background: white;
}