/* =================================================================== */
/* ==                  1. BASE & RESET STYLES                       == */
/* =================================================================== */

/* Reset default browser styles for consistency */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base styles for the entire page */
body {
    font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937; /* Default text color for light mode */
    background-color: #f8fafc; /* Simple, clean background for light mode */
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

/* Helper class to hide elements */
.hidden {
    display: none !important;
}

/* Defines the minimum height for the main content area */
.page-content {
    min-height: calc(100vh - 80px); /* 80px is the height of the navbar */
    transition: opacity 0.2s ease, transform 0.2s ease;
}


/* =================================================================== */
/* ==                 2. ACCESSIBILITY & PRINT                      == */
/* =================================================================== */

/* Styles for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Consistent focus styles for keyboard navigation */
button:focus,
a:focus,
.rule-card:focus,
.quiz-option:focus {
    outline: 3px solid #14b8a6;
    outline-offset: 3px;
    border-radius: 0.5rem;
}

/* Styles for printing the page */
@media print {
    /* Hide non-essential elements for printing */
    nav,
    footer,
    button,
    .btn-primary,
    .btn-secondary {
        display: none !important;
    }
    
    /* Reset styles for printed content for better readability */
    .rule-detail {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        background: white !important;
    }
    
    .arabic-text {
        color: #000 !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}