/**
 * DigitalDuniya - Base CSS
 * Root variables, resets, and foundational styles
 */

/* =====================================================
   CSS CUSTOM PROPERTIES (Variables)
   ===================================================== */
:root {
    /* Primary Colors */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;

    /* Secondary Colors */
    --secondary-50: #fdf4ff;
    --secondary-100: #fae8ff;
    --secondary-200: #f5d0fe;
    --secondary-300: #f0abfc;
    --secondary-400: #e879f9;
    --secondary-500: #d946ef;
    --secondary-600: #c026d3;
    --secondary-700: #a21caf;
    --secondary-800: #86198f;
    --secondary-900: #701a75;

    /* Accent Colors */
    --accent-orange: #ff6b35;
    --accent-green: #10b981;
    --accent-yellow: #fbbf24;
    --accent-red: #ef4444;

    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --black: #000000;

    /* Gradient Colors */
    --gradient-primary: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-500) 0%, var(--secondary-700) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent-orange) 0%, var(--primary-500) 100%);
    --gradient-dark: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-700) 100%);

    /* Typography */
    --font-primary: 'Inter', 'Segoe UI', Roboto, -apple-system, sans-serif;
    --font-heading: 'Poppins', 'Inter', sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;

    /* Font Sizes */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.75rem;     /* 60px */
    --text-7xl: 4.5rem;      /* 72px */

    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* Spacing Scale */
    --space-1: 0.25rem;    /* 4px */
    --space-2: 0.5rem;     /* 8px */
    --space-3: 0.75rem;    /* 12px */
    --space-4: 1rem;       /* 16px */
    --space-5: 1.25rem;    /* 20px */
    --space-6: 1.5rem;     /* 24px */
    --space-8: 2rem;       /* 32px */
    --space-10: 2.5rem;    /* 40px */
    --space-12: 3rem;      /* 48px */
    --space-16: 4rem;      /* 64px */
    --space-20: 5rem;      /* 80px */
    --space-24: 6rem;      /* 96px */
    --space-32: 8rem;      /* 128px */

    /* Border Radius */
    --radius-none: 0;
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-3xl: 1.5rem;
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;

    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* Container Widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;
}

/* =====================================================
   CSS RESET & NORMALIZE
   ===================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--gray-800);
    background-color: var(--white);
    overflow-x: hidden;
    min-height: 100vh;
}

/* =====================================================
   TYPOGRAPHY
   ===================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--gray-900);
    margin-bottom: var(--space-4);
}

h1 { 
    font-size: var(--text-5xl); 
    letter-spacing: -0.025em;
}

h2 { 
    font-size: var(--text-4xl); 
    letter-spacing: -0.025em;
}

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

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

h5 { 
    font-size: var(--text-xl); 
}

h6 { 
    font-size: var(--text-lg); 
}

p {
    margin-bottom: var(--space-4);
    color: var(--gray-700);
}

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

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

strong, b {
    font-weight: var(--font-bold);
}

em, i {
    font-style: italic;
}

small {
    font-size: var(--text-sm);
}

/* =====================================================
   LISTS
   ===================================================== */
ul, ol {
    list-style: none;
}

ul.styled-list, ol.styled-list {
    list-style-position: inside;
    margin-left: var(--space-4);
    margin-bottom: var(--space-4);
}

ul.styled-list {
    list-style-type: disc;
}

ol.styled-list {
    list-style-type: decimal;
}

li {
    margin-bottom: var(--space-2);
}

/* =====================================================
   IMAGES & MEDIA
   ===================================================== */
img, svg, video {
    max-width: 100%;
    height: auto;
    display: block;
}

img {
    border-style: none;
}

/* =====================================================
   FORMS
   ===================================================== */
input, button, textarea, select {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

input:focus, textarea:focus, select:focus {
    outline: none;
}

/* =====================================================
   TABLES
   ===================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

/* =====================================================
   ACCESSIBILITY
   ===================================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles */
*:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* =====================================================
   SELECTION
   ===================================================== */
::selection {
    background-color: var(--primary-200);
    color: var(--primary-900);
}

::-moz-selection {
    background-color: var(--primary-200);
    color: var(--primary-900);
}

/* =====================================================
   SCROLLBAR
   ===================================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* =====================================================
   RESPONSIVE TYPOGRAPHY
   ===================================================== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    h1 { font-size: var(--text-4xl); }
    h2 { font-size: var(--text-3xl); }
    h3 { font-size: var(--text-2xl); }
    h4 { font-size: var(--text-xl); }
    h5 { font-size: var(--text-lg); }
    h6 { font-size: var(--text-base); }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a, a:visited {
        text-decoration: underline;
    }

    img {
        page-break-inside: avoid;
    }

    h2, h3, p {
        orphans: 3;
        widows: 3;
    }

    h2, h3 {
        page-break-after: avoid;
    }
}
