/* Global Styles - Talqaha App */

/* CSS Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary-color: #1E40AF;
    --primary-dark: #1E3A8A;
    --primary-light: #3B82F6;
    --accent-color: #10B981;
    --accent-dark: #059669;
    --accent-light: #34D399;

    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;

    --bg-white: #FFFFFF;
    --bg-gray: #F9FAFB;
    --bg-light-gray: #F3F4F6;

    --border-color: #E5E7EB;
    --border-light: #F3F4F6;

    --error-color: #EF4444;
    --warning-color: #F59E0B;
    --success-color: #10B981;

    /* Spacing - Reduced for more compact mobile layout */
    --spacing-xs: 0.375rem;
    --spacing-sm: 0.625rem;
    --spacing-md: 0.875rem;
    --spacing-lg: 1.125rem;
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;

    /* Typography */
    --font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --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);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-white);
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

/* RTL Specific Fixes */
input,
select,
textarea {
    direction: rtl;
    text-align: right;
}

/* App Container */
#app {
    min-height: 100vh;
    position: relative;
    max-width: 428px;
    margin: 0 auto;
    background-color: var(--bg-white);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    animation: fadeIn var(--transition-base);
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: var(--font-size-3xl);
}

h2 {
    font-size: var(--font-size-2xl);
}

h3 {
    font-size: var(--font-size-xl);
}

p {
    margin-bottom: var(--spacing-md);
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* Lists */
ul, ol {
    list-style-position: inside;
    margin-bottom: var(--spacing-md);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.font-bold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.text-primary {
    color: var(--primary-color);
}

.text-accent {
    color: var(--accent-color);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-light {
    color: var(--text-light);
}

.text-error {
    color: var(--error-color);
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.hidden {
    display: none !important;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner-large {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

.spinner-primary {
    border-color: rgba(30, 64, 175, 0.2);
    border-top-color: var(--primary-color);
}

/* Mobile Responsive Breakpoints */
@media (max-width: 375px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 768px) {
    #app {
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.15);
    }
}
