/**
 * Base Styles
 * Charuchandra College Website
 * 
 * This file contains foundational styles including typography, base element styles,
 * and utility classes that are used throughout the website.
 */

/* ==========================================================================
   BASE ELEMENTS
   ========================================================================== */

/* Enhanced Typography System */
body {
    font-family: var(--font-primary);
    line-height: var(--lh-relaxed);
    color: var(--text-dark);
    font-weight: var(--fw-regular);
    letter-spacing: var(--ls-normal);
    font-feature-settings: "liga" 1, "kern" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

/* Refined Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    color: var(--text-dark);
    text-rendering: optimizeLegibility;
    margin-bottom: var(--space-md);
}

h1 {
    font-weight: var(--fw-bold);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

h2 {
    font-weight: var(--fw-semibold);
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
    font-weight: var(--fw-semibold);
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
}

h4, h5, h6 {
    font-weight: var(--fw-semibold);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
}

/* Body Text */
p, span, div {
    font-family: var(--font-primary);
    line-height: var(--lh-relaxed);
}

/* Lead Text */
.lead {
    font-family: var(--font-body);
    font-weight: var(--fw-regular);
    letter-spacing: var(--ls-normal);
    line-height: var(--lh-loose);
    font-size: 1.125rem;
}

/* Enhanced Quote Styling */
.fst-italic {
    font-family: var(--font-quote);
    font-style: italic;
    line-height: var(--lh-loose);
    letter-spacing: var(--ls-wide);
}

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

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

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

li {
    margin-bottom: var(--space-xs);
    line-height: var(--lh-relaxed);
}

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

/* Form Elements */
input, textarea, select {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: var(--lh-normal);
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

/* Text Utilities */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-accent { color: var(--accent-color) !important; }
.text-light { color: var(--text-light) !important; }
.text-dark { color: var(--text-dark) !important; }

/* Background Utilities */
.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }
.bg-accent { background-color: var(--accent-color) !important; }
.bg-light { background-color: var(--bg-light) !important; }

/* Spacing Utilities */
.m-auto { margin: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.my-auto { margin-top: auto !important; margin-bottom: auto !important; }

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

/* Flexbox Utilities */
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }

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

/* Font Weight */
.fw-light { font-weight: var(--fw-light) !important; }
.fw-normal { font-weight: var(--fw-regular) !important; }
.fw-medium { font-weight: var(--fw-medium) !important; }
.fw-semibold { font-weight: var(--fw-semibold) !important; }
.fw-bold { font-weight: var(--fw-bold) !important; }

/* Border Radius */
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }

/* Transitions */
.transition-fast { transition: var(--transition-fast) !important; }
.transition-normal { transition: var(--transition-normal) !important; }
.transition-slow { transition: var(--transition-slow) !important; }

/* Transform Utilities */
.hover-lift:hover { transform: var(--hover-transform); }
.hover-scale:hover { transform: var(--hover-scale); }
.hover-rotate:hover { transform: var(--hover-rotate); }

/* ==========================================================================
   SCROLLBAR CUSTOMIZATION
   ========================================================================== */

/* Custom Scrollbar for Webkit Browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) var(--bg-light);
}

/* ==========================================================================
   SELECTION STYLES
   ========================================================================== */

::selection {
    background-color: var(--accent-color);
    color: var(--white);
    text-shadow: none;
}

::-moz-selection {
    background-color: var(--accent-color);
    color: var(--white);
    text-shadow: none;
}

/* ==========================================================================
   FOCUS STYLES
   ========================================================================== */

*:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ==========================================================================
   ANIMATION KEYFRAMES
   ========================================================================== */

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

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

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

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

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.7; 
    }
    50% { 
        transform: scale(1.1); 
        opacity: 0.9; 
    }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(1deg); }
    66% { transform: translateY(-10px) rotate(-1deg); }
}

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

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    * {
        color: black !important;
        background: white !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
}