/* Performance Optimizations for SDRSJ College Website */

/* Enable hardware acceleration for smooth animations */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transform: translateZ(0);
}

/* Optimize image loading */
img {
    max-width: 100%;
    height: auto;
}

/* Optimize font loading */
@font-face {
    font-family: 'Oswald';
    font-display: swap;
    src: url('https://fonts.googleapis.com/css2?family=Oswald&display=swap');
}

@font-face {
    font-family: 'Inter';
    font-display: swap;
    src: url('https://fonts.googleapis.com/css2?family=Inter&display=swap');
}

/* Reduce paint on scroll */
.navbar, .footer-section {
    will-change: transform;
}

/* Optimize animations */
.admission-form, .btn, .card {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Critical CSS inlined for faster rendering */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .admission-form {
        padding: 20px;
        margin: 10px;
    }
}

/* Optimize form elements */
.form-control {
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Reduce reflows */
.section-padding {
    padding: 60px 0;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 40px 0;
    }
}

/* Optimize button hover states */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
}

/* Card optimizations */
.card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* Gallery optimizations */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item img {
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Optimize table layout */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

/* Responsive tables */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
}
