/* Mobile-First Responsive Framework */

:root {
    /* Colors */
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --accent-blue: #0ea5e9;
    --light-bg: #f8f9ff;
    --card-bg: #ffffff;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    
    /* 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);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography */
    --font-family-base: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-family-heading: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    /* Transitions */
    --transition-base: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family-base);
    background-color: #ffffff;
    color: var(--text-dark);
    overflow-x: hidden;
    line-height: 1.6;
}

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

h1 {
    font-size: 1.875rem;
    line-height: 1.1;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
}

p {
    margin-bottom: var(--space-md);
    color: var(--text-light);
    line-height: 1.7;
}

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

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

/* Buttons - Mobile First */
.btn {
    display: inline-block;
    padding: var(--space-md) var(--space-lg);
    border: 2px solid transparent;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    width: 100%;
    margin-bottom: var(--space-md);
}

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

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #a78bfa;
    transform: translateY(-2px);
}

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

.btn-outline:hover {
    background-color: var(--light-bg);
}

/* Forms - Mobile First */
.form-group {
    margin-bottom: var(--space-lg);
}

label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--text-dark);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-family: var(--font-family-base);
    font-size: 1rem;
    transition: var(--transition-base);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

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

@media (min-width: 640px) {
    .container {
        max-width: 640px;
        padding: 0 var(--space-lg);
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

/* Grid - Mobile First */
.grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: 1fr;
}

.grid-2 {
    grid-template-columns: 1fr;
}

.grid-3 {
    grid-template-columns: 1fr;
}

.grid-4 {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid {
        gap: var(--space-lg);
    }
    
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Flex Utilities - Mobile First */
.flex {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.flex-row {
    flex-direction: row;
}

.flex-center {
    justify-content: center;
    align-items: center;
}

.flex-between {
    justify-content: space-between;
}

.flex-end {
    justify-content: flex-end;
}

.flex-wrap {
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .flex-md-row {
        flex-direction: row;
    }
}

/* Cards - Mobile First */
.card {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: var(--space-md);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.card-text {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Section - Mobile First */
.section {
    padding: var(--space-2xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-title h2 {
    font-size: 1.875rem;
    margin-bottom: var(--space-md);
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .section {
        padding: var(--space-3xl) 0;
    }
    
    .section-title h2 {
        font-size: 2.25rem;
    }
}

/* Display Utilities */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.d-grid {
    display: grid !important;
}

/* Responsive Utilities */
@media (min-width: 640px) {
    .sm\:d-none {
        display: none !important;
    }
    
    .sm\:d-block {
        display: block !important;
    }
    
    .sm\:d-flex {
        display: flex !important;
    }
}

@media (min-width: 1024px) {
    .md\:d-none {
        display: none !important;
    }
    
    .md\:d-block {
        display: block !important;
    }
    
    .md\:d-flex {
        display: flex !important;
    }
}

/* Spacing Utilities */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.px-md { padding: 0 var(--space-md); }
.px-lg { padding: 0 var(--space-lg); }
.px-xl { padding: 0 var(--space-xl); }

.py-md { padding: var(--space-md) 0; }
.py-lg { padding: var(--space-lg) 0; }
.py-xl { padding: var(--space-xl) 0; }

/* Text Utilities */
.text-center {
    text-align: center;
}

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

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

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

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

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

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

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

/* Background Colors */
.bg-light {
    background-color: var(--light-bg);
}

.bg-primary {
    background-color: var(--primary-color);
    color: white;
}

.bg-secondary {
    background-color: var(--secondary-color);
    color: white;
}

/* Borders */
.border {
    border: 1px solid var(--border-color);
}

.border-top {
    border-top: 1px solid var(--border-color);
}

.border-bottom {
    border-bottom: 1px solid var(--border-color);
}

.rounded {
    border-radius: 0.375rem;
}

.rounded-lg {
    border-radius: 0.75rem;
}

.rounded-full {
    border-radius: 9999px;
}

/* Image Utilities */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-responsive {
    width: 100%;
    height: auto;
}

/* Lists */
ul, ol {
    margin-left: var(--space-lg);
    margin-bottom: var(--space-md);
}

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

/* Tables - Mobile First */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-lg);
}

th, td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--light-bg);
    font-weight: 600;
}

tr:hover {
    background-color: var(--light-bg);
}

/* Responsive Table */
@media (max-width: 768px) {
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: var(--space-sm);
    }
}

/* Badges */
.badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--light-bg);
    color: var(--text-dark);
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

/* Alerts */
.alert {
    padding: var(--space-md);
    border-radius: 0.5rem;
    margin-bottom: var(--space-md);
    border-left: 4px solid;
}

.alert-info {
    background-color: #e0f2fe;
    border-color: var(--accent-blue);
    color: #0369a1;
}

.alert-success {
    background-color: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.alert-error {
    background-color: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

/* Loader */
.loader {
    border: 4px solid var(--light-bg);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
}
