/* Custom CSS for APJ Abdul Kalam Memorial Academy Website */

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: float 20s linear infinite;
    z-index: 1;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-20px, -20px) rotate(360deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    background: linear-gradient(45deg, #ffffff, #f8f9fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.hero-content p {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out 0.5s both;
}

.hero-buttons {
    animation: fadeInUp 1s ease-out 1s both;
}

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

.hero-image img {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: float 3s ease-in-out infinite;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.hero-image img:hover {
    transform: scale(1.05) rotate(1deg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Navigation */
.navbar {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    padding: 1rem 0;
}

.navbar.scrolled {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d96 100%) !important;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
    padding: 0.7rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.6rem;
    color: white !important;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.logo {
    height: 65px;
    width: 65px;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    border: 4px solid rgba(255, 255, 255, 0.5);
    object-fit: cover;
    margin-right: 15px;
    background: white;
    padding: 3px;
    display: block;
}

.brand-text {
    display: inline-block;
}

.navbar-brand:hover {
    transform: scale(1.05);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.navbar-brand:hover .logo {
    transform: rotate(10deg) scale(1.15);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.7);
}

.navbar-brand:hover i {
    transform: rotate(12deg) scale(1.1);
}

.nav-link {
    font-weight: 600;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0 8px;
    padding: 8px 12px !important;
    border-radius: 6px;
    position: relative;
}

.nav-link:hover {
    color: #ffc107 !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #ffc107;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* About Section */
.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.stat-card i {
    transition: all 0.3s ease;
}

.stat-card:hover i {
    transform: scale(1.2) rotate(5deg);
}

.stat-card h4 {
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

/* Academics Section */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #ffc107);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.card i {
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card:hover i {
    transform: scale(1.2) rotate(10deg);
}

.card-title {
    font-weight: 700;
    color: #2c3e50;
}

.card-text {
    color: #6c757d;
    line-height: 1.6;
}

/* Facilities Section */
.facility-item {
    padding: 2.5rem;
    border-radius: 15px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.facility-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.facility-item:hover::before {
    opacity: 1;
}

.facility-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.facility-item i {
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.facility-item:hover i {
    transform: scale(1.3) rotate(15deg);
}

.facility-item h5 {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.facility-item p {
    color: #6c757d;
    font-weight: 500;
}

/* Gallery Section */
.gallery-container {
    position: relative;
}

.gallery-item {
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gallery-item::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 2rem;
    z-index: 2;
    transition: transform 0.3s ease;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    transition: transform 0.3s ease;
    width: 100%;
    height: 250px;
    object-fit: cover;
    object-position: top;
}

.gallery-item:hover img {
    transform: scale(1.1);
    filter: brightness(0.8);
}

/* Contact Section */
.contact-form {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.contact-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #ffc107);
}

.contact-info {
    padding: 2.5rem;
    border-radius: 15px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.contact-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-info:hover::before {
    opacity: 1;
}

.contact-info:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.contact-info i {
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-info:hover i {
    transform: scale(1.3) rotate(10deg);
}

.contact-info h5 {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.contact-info p {
    color: #6c757d;
    font-weight: 500;
    line-height: 1.6;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2, #ffc107);
}

footer h5 {
    background: linear-gradient(45deg, #ffffff, #f8f9fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.social-links a {
    transition: all 0.3s ease;
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.social-links a:hover {
    color: #ffc107 !important;
    transform: translateY(-5px) rotate(360deg);
    background: rgba(255, 193, 7, 0.2);
    box-shadow: 0 8px 16px rgba(255, 193, 7, 0.3);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: none;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    position: relative;
    overflow: hidden;
}

.back-to-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.back-to-top:hover::before {
    left: 100%;
}

.back-to-top:hover {
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.back-to-top.show {
    display: block;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff8800 100%);
    border: none;
    border-radius: 50px;
    padding: 15px 35px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-warning::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-warning:hover::before {
    left: 100%;
}

.btn-warning:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(255, 193, 7, 0.4);
}

.btn-outline-light {
    border: 2px solid white;
    border-radius: 50px;
    padding: 15px 35px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-outline-light::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: white;
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-outline-light:hover::before {
    width: 100%;
}

.btn-outline-light:hover {
    color: #667eea !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .hero-image {
        margin-top: 2rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .facility-item {
        margin-bottom: 1rem;
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .logo {
        height: 55px;
        width: 55px;
        margin-right: 12px;
    }
    
    .brand-text {
        font-size: 1.2rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .hero-section .display-4 {
        font-size: 1.5rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .gallery-item img {
        height: 150px;
    }
    
    .hero-image {
        margin-top: 2rem;
    }
    
    .hero-image img {
        max-width: 100%;
        height: auto;
        margin-top: 0;
        padding-top: 0;
    }
    
    /* Fix for all images on mobile */
    img {
        max-width: 100% !important;
        height: auto !important;
        object-fit: cover;
    }
    
    /* Fix for gallery images */
    .gallery-item img {
        height: 200px !important;
        object-fit: cover;
        object-position: top;
    }
    
    /* Fix for hero section images */
    .hero-section img {
        margin-top: 1rem !important;
    }
    
    .logo {
        height: 50px;
        width: 50px;
        margin-right: 10px;
    }
    
    .brand-text {
        font-size: 1rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Section Spacing */
section {
    padding-top: 80px;
    padding-bottom: 80px;
}

/* Fix for navbar overlap on specific pages */
section[style*="padding-top"] {
    padding-top: 220px !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0d6efd 0%, #764ba2 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0056b3 0%, #667eea 100%);
}

/* Success Message Styles */
.success-message {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

/* Error Message Styles */
.error-message {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

/* Animation for sections on scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}
