/* Universal CSS Template for Topacy Educational Platform */

/* CSS Variables - Color System */
:root {
    /* Base Colors */
    --color-bg: #F9FAFB;        /* Light neutral background */
    --color-text: #111827;      /* Dark gray for text (softer than black) */
    --color-border: #E5E7EB;    /* Light gray borders/dividers */

    /* Primary Blue */
    --color-primary: #2563EB;   /* Medium modern blue (buttons, highlights) */
    --color-primary-hover: #1D4ED8; /* Darker blue for hover */
    --color-primary-light: #DBEAFE; /* Light tint for backgrounds/highlights */

    /* Header/Footer */
    --color-header: #1E3A8A;    /* Deep navy for strong sections */
    --color-footer: #1E3A8A;

    /* Accent */
    --color-accent: #3B82F6;    /* For icons, links, small highlights */
    
    /* Additional common colors */
    --color-success: #10B981;   /* Green for success states */
    --color-error: #EF4444;     /* Red for error states */
    --color-warning: #F59E0B;   /* Amber for warnings */
}

/* Typography System */
h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: var(--color-header);
}

h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-header);
}

h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-header);
}

h4 {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-header);
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

p {
    margin-bottom: 1rem;
}

small, .label {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* Button Styles */
button, .btn {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.5px;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    background-color: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: inline-block;
    text-decoration: none;
}

button:hover, .btn:hover {
    background-color: var(--color-primary-hover);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
    transform: translateY(-1px);
}

button:active, .btn:active {
    transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
    background-color: white;
    color: var(--color-primary);
    border: 2px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-bg);
    border-color: var(--color-primary);
}

/* Small Button */
.btn-sm {
    font-size: 14px;
    padding: 0.5rem 1rem;
}

/* Large Button */
.btn-lg {
    font-size: 18px;
    padding: 1rem 1.5rem;
}

/* Link Styles */
a {
    color: var(--color-accent);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

a:hover {
    opacity: 0.8;
}

/* Card Component */
.card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-header);
}

.card-content {
    color: var(--color-text);
}

/* Container Layouts */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

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

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

/* Section Spacing */
.section {
    padding: 3rem 0;
}

.section-sm {
    padding: 2rem 0;
}

.section-lg {
    padding: 4rem 0;
}

/* Header Styles */
.hero-section {
    background-color: var(--color-header);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero-section h1 {
    color: white;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Navigation Components */
.nav-button {
    background-color: var(--color-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.nav-button:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
    text-decoration: none;
}

/* Form Elements */
input, textarea, select {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    width: 100%;
    transition: all 0.2s ease-in-out;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text);
}

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

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

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.pt-1 { padding-top: 0.5rem; }
.pt-2 { padding-top: 1rem; }
.pt-3 { padding-top: 1.5rem; }
.pt-4 { padding-top: 2rem; }

.pb-1 { padding-bottom: 0.5rem; }
.pb-2 { padding-bottom: 1rem; }
.pb-3 { padding-bottom: 1.5rem; }
.pb-4 { padding-bottom: 2rem; }

/* Flex Utilities */
.d-flex {
    display: flex;
}

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

.justify-center {
    justify-content: center;
}

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

.align-center {
    align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Grid System */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Visibility */
.hidden {
    display: none !important;
}

.visible {
    visibility: visible !important;
}

.invisible {
    visibility: hidden !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Typography adjustments */
    h1 {
        font-size: 30px;
    }
    
    h2 {
        font-size: 24px;
    }
    
    h3 {
        font-size: 19px;
    }
    
    body {
        font-size: 15px;
    }
    
    /* Grid responsive */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    /* Section spacing */
    .section {
        padding: 2rem 0;
    }
    
    .section-lg {
        padding: 3rem 0;
    }
    
    /* Hero section */
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    /* Typography adjustments */
    h1 {
        font-size: 26px;
    }
    
    h2 {
        font-size: 22px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    body {
        font-size: 14px;
    }
    
    /* Button adjustments */
    button, .btn {
        font-size: 14px;
        padding: 0.6rem 1rem;
    }
    
    /* Container padding */
    .container {
        padding: 0 1rem;
    }
    
    /* Card padding */
    .card {
        padding: 1rem;
    }
}

@media (max-width: 320px) {
    /* Small screen typography */
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    /* Minimal padding */
    .container {
        padding: 0 0.75rem;
    }
    
    button, .btn {
        font-size: 13px;
        padding: 0.5rem 0.75rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-in-out;
}

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

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

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .no-print {
        display: none !important;
    }
}