/* Custom CSS for UJJWAL ACADEMICS */

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

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

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

/* Apply animations to elements */
.animate-fade-in {
    animation: fadeInUp 0.8s ease-out;
}

.animate-slide-left {
    animation: slideInLeft 0.8s ease-out;
}

.animate-slide-right {
    animation: slideInRight 0.8s ease-out;
}

/* Custom gradients */
.gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

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

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

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading animation */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Custom button styles */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(240, 147, 251, 0.3);
}

/* Card styles */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

/* Form styles */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Alert styles */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-info {
    background-color: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.alert-success {
    background-color: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.alert-warning {
    background-color: #fef3c7;
    border: 1px solid #fbbf24;
    color: #92400e;
}

.alert-error {
    background-color: #fee2e2;
    border: 1px solid #f87171;
    color: #991b1b;
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Table styles */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.table tr:hover {
    background-color: #f9fafb;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
}

.modal-close:hover {
    color: #374151;
}

/* Utility classes */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1;
}

/* ===== MOBILE RESPONSIVE STYLES ===== */

/* Mobile Navigation */
@media (max-width: 768px) {
    /* Navigation adjustments */
    nav .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    nav h1 {
        font-size: 1.25rem !important;
    }
    
    nav p {
        font-size: 0.75rem !important;
    }
    
    /* Mobile menu improvements */
    #mobileMenu {
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    #mobileMenu a {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #f3f4f6;
        font-size: 1rem;
    }
    
    #mobileMenu a:last-child {
        border-bottom: none;
    }
}

/* Hero Section Mobile */
@media (max-width: 768px) {
    #home h1 {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    #home p {
        font-size: 1rem !important;
        margin-bottom: 1.5rem !important;
        padding: 0 1rem;
    }
    
    #home .flex {
        flex-direction: column !important;
        gap: 1rem !important;
        padding: 0 1rem;
    }
    
    #home a {
        width: 100% !important;
        text-align: center !important;
        padding: 0.875rem 1.5rem !important;
    }
}

/* About Section Mobile */
@media (max-width: 768px) {
    #about .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    #about .text-4xl {
        font-size: 2rem !important;
    }
    
    #about .text-xl {
        font-size: 1rem !important;
    }
    
    #about .text-lg {
        font-size: 0.875rem !important;
    }
    
    #about .p-8 {
        padding: 1.5rem !important;
    }
    
    #about .space-y-4 > * + * {
        margin-top: 1rem !important;
    }
}

/* Courses Section Mobile */
@media (max-width: 768px) {
    #courses .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    #courses .p-6 {
        padding: 1.5rem !important;
    }
    
    #courses .text-2xl {
        font-size: 1.5rem !important;
    }
    
    #courses .text-lg {
        font-size: 1rem !important;
    }
}

/* Faculty Section Mobile */
@media (max-width: 768px) {
    #faculty .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    #faculty .p-6 {
        padding: 1.5rem !important;
    }
    
    #faculty .text-xl {
        font-size: 1.25rem !important;
    }
    
    #faculty .text-sm {
        font-size: 0.875rem !important;
    }
}

/* Gallery Section Mobile */
@media (max-width: 768px) {
    #gallery .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    #gallery .p-4 {
        padding: 1rem !important;
    }
    
    #gallery .text-lg {
        font-size: 1rem !important;
    }
    
    #gallery .text-sm {
        font-size: 0.75rem !important;
    }
}

/* Testimonials Section Mobile */
@media (max-width: 768px) {
    #testimonials .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    #testimonials .p-6 {
        padding: 1.5rem !important;
    }
    
    #testimonials .text-lg {
        font-size: 1rem !important;
    }
    
    #testimonials .text-sm {
        font-size: 0.875rem !important;
    }
}

/* Events Section Mobile */
@media (max-width: 768px) {
    #events .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    #events .p-6 {
        padding: 1.5rem !important;
    }
    
    #events .text-xl {
        font-size: 1.25rem !important;
    }
    
    #events .text-sm {
        font-size: 0.875rem !important;
    }
}

/* News Section Mobile */
@media (max-width: 768px) {
    #news .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    #news .p-6 {
        padding: 1.5rem !important;
    }
    
    #news .text-xl {
        font-size: 1.25rem !important;
    }
    
    #news .text-sm {
        font-size: 0.875rem !important;
    }
}

/* Contact Section Mobile */
@media (max-width: 768px) {
    #contact .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    #contact .p-8 {
        padding: 1.5rem !important;
    }
    
    #contact .text-3xl {
        font-size: 2rem !important;
    }
    
    #contact .text-lg {
        font-size: 1rem !important;
    }
    
    #contact .space-y-4 > * + * {
        margin-top: 1rem !important;
    }
}

/* Footer Mobile */
@media (max-width: 768px) {
    footer .grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center !important;
    }
    
    footer .p-8 {
        padding: 2rem 1.5rem !important;
    }
    
    footer .text-2xl {
        font-size: 1.5rem !important;
    }
    
    footer .text-lg {
        font-size: 1rem !important;
    }
}

/* General Mobile Improvements */
@media (max-width: 768px) {
    /* Container padding */
    .max-w-7xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Section padding */
    section {
        padding: 3rem 1rem !important;
    }
    
    /* Text sizes */
    .text-5xl, .text-6xl, .text-7xl {
        font-size: 2.5rem !important;
    }
    
    .text-4xl {
        font-size: 2rem !important;
    }
    
    .text-3xl {
        font-size: 1.75rem !important;
    }
    
    .text-2xl {
        font-size: 1.5rem !important;
    }
    
    .text-xl {
        font-size: 1.25rem !important;
    }
    
    /* Spacing adjustments */
    .mb-8, .mb-12, .mb-16 {
        margin-bottom: 2rem !important;
    }
    
    .mt-8, .mt-12, .mt-16 {
        margin-top: 2rem !important;
    }
    
    .py-8, .py-12, .py-16 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Button improvements */
    .px-8 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    .py-3 {
        padding-top: 0.875rem !important;
        padding-bottom: 0.875rem !important;
    }
    
    /* Card improvements */
    .p-6, .p-8 {
        padding: 1.5rem !important;
    }
    
    /* Grid improvements */
    .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: 1fr !important;
    }
    
    /* Flex improvements */
    .flex-row {
        flex-direction: column !important;
    }
    
    .space-x-4 > * + *,
    .space-x-6 > * + *,
    .space-x-8 > * + * {
        margin-left: 0 !important;
        margin-top: 1rem !important;
    }
    
    .space-y-4 > * + * {
        margin-top: 1rem !important;
    }
    
    .space-y-6 > * + * {
        margin-top: 1.5rem !important;
    }
    
    .space-y-8 > * + * {
        margin-top: 2rem !important;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    /* Even smaller text for very small screens */
    #home h1 {
        font-size: 2rem !important;
    }
    
    #home p {
        font-size: 0.875rem !important;
    }
    
    /* Tighter spacing */
    section {
        padding: 2rem 0.75rem !important;
    }
    
    .max-w-7xl {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* Smaller buttons */
    .px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .py-3 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
}

/* Modal Mobile Improvements */
@media (max-width: 768px) {
    .modal-content {
        width: 95% !important;
        margin: 10% auto !important;
        padding: 1rem !important;
    }
    
    .table {
        font-size: 0.875rem !important;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.75rem !important;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

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

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    z-index: 1;
}

.hero-gradient > * {
    position: relative;
    z-index: 2;
}

/* Alternative approach - direct background */
#home.hero-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Fallback for browsers that don't support gradients */
#home.hero-gradient {
    background-color: #667eea !important;
}

/* Ensure the section has proper dimensions */
section#home.hero-gradient {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

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

/* Notification badge animation */
.notification-badge {
    animation: pulse 2s infinite;
}

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

/* Enhanced 3D Animation Container */
#threejs-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

#threejs-container canvas {
    filter: blur(0.5px);
    opacity: 0.15;
    transition: opacity 0.3s ease;
}

/* 3D Animation hover effects */
.hero-gradient:hover #threejs-container canvas {
    opacity: 0.25;
    filter: blur(0.3px);
}

/* Responsive 3D container */
@media (max-width: 768px) {
    #threejs-container canvas {
        opacity: 0.1;
        filter: blur(1px);
    }
    
    .hero-gradient:hover #threejs-container canvas {
        opacity: 0.15;
        filter: blur(0.8px);
    }
}

/* Performance optimization for 3D */
@media (prefers-reduced-motion: reduce) {
    #threejs-container {
        display: none;
    }
}

/* ===== ADDITIONAL MOBILE ENHANCEMENTS ===== */

/* Touch-friendly improvements */
@media (max-width: 768px) {
    /* Better touch targets */
    button, a, input, select, textarea {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    /* Improved button spacing */
    .btn-primary, .btn-secondary {
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
        border-radius: 12px !important;
    }
    
    /* Better form inputs */
    .form-input {
        padding: 1rem !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        border-radius: 12px !important;
    }
    
    /* Improved card touch experience */
    .card {
        border-radius: 20px !important;
        margin: 0.5rem !important;
    }
    
    /* Better spacing for mobile */
    .space-y-4 > * + * {
        margin-top: 1.5rem !important;
    }
    
    .space-y-6 > * + * {
        margin-top: 2rem !important;
    }
    
    .space-y-8 > * + * {
        margin-top: 2.5rem !important;
    }
    
    /* Improved navigation touch */
    nav a {
        padding: 0.75rem 1rem !important;
        border-radius: 8px !important;
    }
    
    /* Better mobile menu */
    #mobileMenu {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: white !important;
        border-top: 1px solid #e5e7eb !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
        z-index: 1000 !important;
    }
    
    #mobileMenu a {
        display: block !important;
        padding: 1rem 1.5rem !important;
        border-bottom: 1px solid #f3f4f6 !important;
        font-size: 1.1rem !important;
        font-weight: 500 !important;
        transition: all 0.2s ease !important;
    }
    
    #mobileMenu a:hover {
        background-color: #f8fafc !important;
        color: #3b82f6 !important;
        padding-left: 2rem !important;
    }
    
    #mobileMenu a:last-child {
        border-bottom: none !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
        margin: 1rem !important;
        border-radius: 12px !important;
        text-align: center !important;
    }
    
    #mobileMenu a:last-child:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3) !important;
    }
}

/* Landscape mobile improvements */
@media (max-width: 768px) and (orientation: landscape) {
    #home h1 {
        font-size: 2rem !important;
    }
    
    #home p {
        font-size: 0.875rem !important;
    }
    
    section {
        padding: 2rem 1rem !important;
    }
    
    .hero-gradient {
        min-height: 80vh !important;
    }
}

/* High DPI mobile devices */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card {
        border: 1px solid rgba(0, 0, 0, 0.05) !important;
    }
    
    button, a {
        -webkit-tap-highlight-color: transparent !important;
    }
}

/* Mobile performance optimizations */
@media (max-width: 768px) {
    /* Reduce animations on mobile for better performance */
    .animate-fade-in,
    .animate-slide-left,
    .animate-slide-right {
        animation-duration: 0.5s !important;
    }
    
    /* Optimize 3D effects for mobile */
    #threejs-container canvas {
        opacity: 0.05 !important;
        filter: blur(2px) !important;
    }
    
    /* Reduce hover effects on mobile */
    .hover-lift:hover {
        transform: none !important;
    }
    
    .card:hover {
        transform: none !important;
    }
    
    /* Better mobile shadows */
    .card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    }
    
    /* Improved mobile typography */
    body {
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
        text-rendering: optimizeLegibility !important;
    }
    
    /* Better mobile spacing */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Mobile-specific grid improvements */
    .grid {
        gap: 1rem !important;
    }
    
    /* Better mobile button groups */
    .flex.flex-col.md\\:flex-row {
        gap: 1rem !important;
    }
    
    .flex.flex-col.md\\:flex-row > * {
        width: 100% !important;
    }
}
