/* =============================================
   Qasim Jamil - Main Stylesheet
   Premium Pakistani Men's Traditional Wear
   ============================================= */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* =============================================
   CSS Variables
   ============================================= */
:root {
    /* Primary Colors - Olive/Khaki */
    --color-primary: #7D7545;
    --color-primary-dark: #5C5633;
    --color-primary-light: #9A9260;

    /* Secondary Colors - Warm Gold */
    --color-secondary: #A69460;
    --color-secondary-dark: #8A7A4D;
    --color-secondary-light: #BBA973;

    /* Accent Colors - Muted Burgundy */
    --color-accent: #6B4C4C;
    --color-accent-dark: #523939;
    --color-accent-light: #8A6363;

    /* Neutral Colors - Modern White/Grey */
    --color-white: #FFFFFF;
    --color-off-white: #F8F8F6;
    --color-light-gray: #EBEBEB;
    --color-gray: #D4D4D4;
    --color-dark-gray: #6B6B6B;
    --color-text: #2D2D2D;
    --color-text-light: #4A4A4A;
    --color-black: #1A1A1A;

    /* Status Colors */
    --color-success: #28a745;
    --color-error: #dc3545;
    --color-warning: #ffc107;
    --color-info: #17a2b8;

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;

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

    /* Spacing (8px grid) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;

    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-tooltip: 600;

    /* Container */
    --container-max: 1400px;
    --container-padding: 1.5rem;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-semibold);
    line-height: 1.2;
    color: var(--color-text);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
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);
}

p:last-child {
    margin-bottom: 0;
}

/* =============================================
   Utility Classes
   ============================================= */

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.container-sm {
    max-width: 900px;
}

.container-lg {
    max-width: 1600px;
}

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text Colors */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-dark-gray); }
.text-white { color: var(--color-white); }

/* Background Colors */
.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-secondary); }
.bg-accent { background-color: var(--color-accent); }
.bg-white { background-color: var(--color-white); }
.bg-light { background-color: var(--color-off-white); }

/* Font Weights */
.font-light { font-weight: var(--font-light); }
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Flexbox */
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Margin */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* Padding */
.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.py-16 { padding-top: var(--space-16); padding-bottom: var(--space-16); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

/* Width/Height */
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

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

/* =============================================
   Section Styles
   ============================================= */
.section {
    padding: var(--space-16) 0;
}

.section-sm {
    padding: var(--space-12) 0;
}

.section-lg {
    padding: var(--space-20) 0;
}

.section-title {
    font-size: var(--text-4xl);
    text-align: center;
    margin-bottom: var(--space-2);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--color-dark-gray);
    text-align: center;
    margin-bottom: var(--space-12);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* =============================================
   Form Elements
   ============================================= */
.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    margin-bottom: var(--space-2);
    color: var(--color-text);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    border: 1px solid var(--color-gray);
    border-radius: var(--radius-md);
    background-color: var(--color-white);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(125, 117, 69, 0.15);
}

.form-input::placeholder {
    color: var(--color-dark-gray);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-checkbox,
.form-radio {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.form-checkbox input,
.form-radio input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.form-error {
    font-size: var(--text-sm);
    color: var(--color-error);
    margin-top: var(--space-1);
}

/* =============================================
   Links
   ============================================= */
.link {
    color: var(--color-primary);
    text-decoration: underline;
    transition: color var(--transition-fast);
}

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

.link-subtle {
    color: var(--color-dark-gray);
    transition: color var(--transition-fast);
}

.link-subtle:hover {
    color: var(--color-primary);
}

/* =============================================
   Breadcrumb
   ============================================= */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) 0;
    font-size: var(--text-sm);
    color: var(--color-dark-gray);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    color: var(--color-gray);
}

.breadcrumb-link {
    transition: color var(--transition-fast);
}

.breadcrumb-link:hover {
    color: var(--color-primary);
}

.breadcrumb-current {
    color: var(--color-text);
    font-weight: var(--font-medium);
}

/* =============================================
   Pagination
   ============================================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-12);
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-gray);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.pagination-btn.active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =============================================
   Tables
   ============================================= */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-light-gray);
}

.table th {
    font-weight: var(--font-semibold);
    background-color: var(--color-off-white);
}

.table tbody tr:hover {
    background-color: var(--color-off-white);
}

/* =============================================
   Animations
   ============================================= */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.animate-fade-in {
    animation: fadeIn var(--transition-normal) forwards;
}

.animate-fade-in-up {
    animation: fadeInUp var(--transition-normal) forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* =============================================
   Scroll Animations
   ============================================= */

/* Scroll Animation Base */
.scroll-animate {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate.visible {
    opacity: 1;
    transform: none;
}

/* Direction Variants */
.scroll-fade-up {
    transform: translateY(30px);
}

.scroll-fade-down {
    transform: translateY(-30px);
}

.scroll-fade-left {
    transform: translateX(30px);
}

.scroll-fade-right {
    transform: translateX(-30px);
}

.scroll-zoom-in {
    transform: scale(0.95);
}

/* Stagger Delays (for grid items) */
.stagger-1 { transition-delay: 0ms; }
.stagger-2 { transition-delay: 50ms; }
.stagger-3 { transition-delay: 100ms; }
.stagger-4 { transition-delay: 150ms; }
.stagger-5 { transition-delay: 200ms; }
.stagger-6 { transition-delay: 250ms; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .scroll-animate {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* =============================================
   Loading Spinner
   ============================================= */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-light-gray);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* =============================================
   Skeleton Loading
   ============================================= */
.skeleton {
    background: linear-gradient(90deg, var(--color-light-gray) 25%, var(--color-off-white) 50%, var(--color-light-gray) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =============================================
   Image Placeholders
   ============================================= */
.img-placeholder {
    background-color: var(--color-light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-dark-gray);
}

.img-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}
