/* Custom Styles for New Pallavi Site */

:root {
    --primary-hex: #ef4444;
    --secondary-hex: #0f172a;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-hex: #f87171;
        --secondary-hex: #1e293b;
    }
    body {
        background-color: #0f172a;
        color: #f1f5f9;
    }
    .card {
        background: #1e293b;
        color: #f1f5f9;
    }
    /* Add more dark mode overrides as needed */
}

* {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body.editing .editable {
    outline: 2px dashed rgba(14, 165, 233, 0.6);
    outline-offset: 2px;
    cursor: text;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(15, 23, 42, 0.75);
    z-index: 60;
}

.admin-image-controls {
    display: none;
}

body.editing .admin-image-controls {
    display: flex;
}

/* Image popup styles */
#image-popup {
    display: none;
    align-items: center;
    justify-content: center;
}

#image-popup.show {
    display: flex;
}

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

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

.gradient-light {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

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

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

/* Section titles */
.section-title {
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-hex), rgba(239, 68, 68, 0.3));
    border-radius: 2px;
}

/* Badge styles */
.badge-shine {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.badge-shine:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Stat counter animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Navbar enhancements */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-hex);
    transition: width 0.3s ease;
}

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

/* Button enhancements */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-hex), #d84040);
    transition: all 0.3s ease;
}

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

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

.lightbox-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    align-items: center;
    justify-content: center;
    color: white;
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Admin dashboard styles */
.admin-dashboard {
    display: none;
    position: fixed;
    z-index: 55;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.admin-dashboard.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
    padding-bottom: 20px;
}

.dashboard-panel {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 30px;
}

.dashboard-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.dashboard-stat-number {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.dashboard-stat-label {
    font-size: 0.9em;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

/* Social feed styles */
.social-feed-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.social-feed-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.social-feed-header {
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-feed-content {
    padding: 15px;
    text-align: center;
    color: #666;
}

.social-feed-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Hero overlay enhancement */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.4), rgba(239, 68, 68, 0.2));
    z-index: 1;
}

.hero-image-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Accessibility & focus styles */
:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid rgba(59,130,246,0.9);
    outline-offset: 3px;
    border-radius: 6px;
}

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

.social-icon {
    font-size: 18px;
    width: 1em; height: 1em; display: inline-block; vertical-align: middle;
}

a, button {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

a:focus-visible, button:focus-visible {
    box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}

/* Unified card styles for statistics and small cards */
.card {
    background: white;
    padding: 1.75rem;
    border-radius: 0.75rem;
    text-align: center;
    box-shadow: 0 10px 25px rgba(2,6,23,0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(2,6,23,0.09); }
.stat-number { font-size: 2.25rem; font-weight: 800; }
.stat-label { color: #475569; margin-top: 0.5rem; font-weight: 700; }

/* Gallery LQIP (low-quality image placeholder) */
.gallery-wrapper { position: relative; overflow: hidden; }
.gallery-placeholder { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(14px) scale(1.06); transition: opacity .45s ease, filter .45s ease; }
.gallery-img { display: block; width:100%; height:100%; object-fit:cover; position: relative; z-index: 2; opacity: 0; transition: opacity .35s ease, transform .5s ease; }
.gallery-wrapper.loaded .gallery-placeholder { opacity: 0; filter: blur(0px) scale(1); }
.gallery-wrapper.loaded .gallery-img { opacity: 1; transform: none; }

/* Print styles */
@media print {
    .admin-image-controls, .lightbox-modal, .admin-dashboard, .modal-backdrop, .floating-admin-controls {
        display: none !important;
    }
    body {
        font-size: 12pt;
        color: black;
        background: white;
    }
    a {
        text-decoration: underline;
        color: black;
    }
    img {
        max-width: 100%;
        height: auto;
    }
    .card, .card-hover {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}