/*
    SHARED.CSS - Base Styles and CSS Custom Properties
    This file contains global styles, variables, and base component styles
*/

/* ===== 1. CSS CUSTOM PROPERTIES ===== */
:root {
    /* Colors */
    --primary-color: #4A90E2;
    --primary-hover: #357abd;
    --secondary-color: #00bcd4;
    --dark-blue: #1a1a2e;
    --text-color: #333;
    --text-light: #666;
    --text-muted: #7f8c8d;
    --light-bg: #f8f9fa;
    --white: #fff;
    --border-color: #e5e7eb;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    
    /* Shadows */
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-heavy: rgba(0, 0, 0, 0.2);
    --shadow-hover: rgba(0, 0, 0, 0.25);
    
    /* Transitions */
    --transition-speed: 0.3s;
    --transition-ease: ease;
    
    /* Border Radius */
    --border-radius-sm: 8px;
    --border-radius: 10px;
    --border-radius-md: 15px;
    --border-radius-lg: 20px;
    --border-radius-xl: 30px;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Font Sizes */
    --font-xs: 0.8rem;
    --font-sm: 0.9rem;
    --font-base: 1rem;
    --font-md: 1.1rem;
    --font-lg: 1.2rem;
    --font-xl: 1.5rem;
    --font-2xl: 2rem;
    --font-3xl: 2.5rem;
    --font-4xl: 3rem;
}

/* ===== 2. GLOBAL RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    overflow-x: hidden;
}

/* ===== 3. TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark-blue);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
}

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

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-light);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) var(--transition-ease);
}

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

/* ===== 4. LAYOUT UTILITIES ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

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

.section-title {
    font-size: var(--font-3xl);
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.section-subtitle {
    font-size: var(--font-lg);
    color: var(--text-light);
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

/* ===== 5. BUTTON SYSTEM ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-xl);
    font-size: var(--font-base);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-ease);
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

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

/* Button Sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: var(--font-sm);
}

.btn-md {
    padding: 12px 24px;
    font-size: var(--font-base);
}

.btn-lg {
    padding: 16px 32px;
    font-size: var(--font-lg);
}

/* ===== 6. FORM ELEMENTS ===== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-base);
    transition: border-color var(--transition-speed) var(--transition-ease);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* ===== 7. CARD SYSTEM ===== */
.card {
    background: var(--white);
    border-radius: var(--border-radius-md);
    box-shadow: 0 5px 20px var(--shadow-light);
    overflow: hidden;
    transition: all var(--transition-speed) var(--transition-ease);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--shadow-medium);
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background: var(--light-bg);
}

/* ===== 8. GRID SYSTEM ===== */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ===== 9. ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.animate-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.animate-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-pop-in {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.6s ease-out;
}

.animate-pop-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* ===== 10. UTILITY CLASSES ===== */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }

.rounded { border-radius: var(--border-radius); }
.rounded-lg { border-radius: var(--border-radius-md); }
.rounded-full { border-radius: 50%; }

.shadow { box-shadow: 0 2px 10px var(--shadow-light); }
.shadow-lg { box-shadow: 0 10px 30px var(--shadow-medium); }

/* ===== 11. RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root {
        --font-4xl: 2.5rem;
        --font-3xl: 2rem;
        --font-2xl: 1.75rem;
    }
    
    /* MODIFICATION: Add top padding to the body to prevent content
       from being hidden by the taller fixed mobile header. */
    body {
        padding-top: 220px; /* Adjust this value if the mobile header height changes */
    }

    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: var(--font-sm);
    }
}

@media (max-width: 480px) {
    :root {
        --font-4xl: 2rem;
        --font-3xl: 1.75rem;
        --font-2xl: 1.5rem;
    }
    
    .section-title {
        font-size: var(--font-2xl);
    }
}