/* ============================================
   Custom Enhancements for K-12 School Template
   World-Class Visual Polish & Refinements
   ============================================ */

/* Smooth Transitions for All Interactive Elements */
* {
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}

/* Enhanced Card Hover Effects */
.category-item,
.event-item,
.h2_blog-item,
.h2_teacher-item {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.category-item:hover,
.event-item:hover,
.h2_blog-item:hover,
.h2_teacher-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12) !important;
}

/* Smooth Button Animations */
.theme-btn,
.header-btn,
.cta-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.theme-btn:hover::before {
    width: 300px;
    height: 300px;
}

.theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Responsive Logo Scaling */
.header-logo img {
    width: clamp(80px, 8vw, 120px);
    height: auto;
    object-fit: contain;
    transition: width 0.3s ease, transform 0.3s ease;
}

.header-logo img:hover {
    transform: scale(1.05);
}

/* Sticky Header Logo Scaling */
.header-sticky.sticky .header-logo img {
    width: clamp(60px, 6vw, 90px);
}

/* Enhanced Section Transitions */
section {
    opacity: 1;
    animation: fadeInSection 0.6s ease-out;
}

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

/* Improved Image Loading & Display */
img {
    transition: opacity 0.3s ease, transform 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.category-item img,
.event-item img,
.h2_blog-item img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-item:hover img,
.event-item:hover img,
.h2_blog-item:hover img {
    transform: scale(1.05);
}

/* Enhanced Typography Smoothness */
h1, h2, h3, h4, h5, h6,
.section-title,
.breadcrumb-title {
    font-smooth: always;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Improved Focus States for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--clr-theme-primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Enhanced Form Elements */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    border-color: var(--clr-theme-primary);
    box-shadow: 0 0 0 3px rgba(var(--clr-theme-primary-rgb), 0.1);
}

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

/* Enhanced Mobile Menu Transitions */
.side-info {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.offcanvas-overlay {
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Improved Spacing & Visual Hierarchy */
.section-area {
    position: relative;
}

.section-subtitle {
    letter-spacing: 1px;
    font-weight: 600;
}

/* Enhanced Event Cards */
.event-item {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
}

.event-content {
    padding: 25px;
}

.event-content-title {
    line-height: 1.4;
    margin-bottom: 15px;
}

/* Improved Announcement Cards */
.h2_blog-item {
    transition: all 0.3s ease;
}

.h2_blog-item:hover {
    transform: translateY(-8px);
}

/* Better Visual Hierarchy for Principal Message */
.principal-quote {
    position: relative;
    overflow: hidden;
}

.principal-quote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 80px;
    color: var(--clr-theme-primary);
    opacity: 0.1;
    font-family: Georgia, serif;
    line-height: 1;
}

/* School Division Cards Enhancement */
.category-item[style*="border-radius: 15px"] {
    background: #fff;
    border: 1px solid #f0f0f0;
}

.category-item[style*="border-radius: 15px"]:hover {
    border-color: var(--clr-theme-primary);
    transform: translateY(-8px);
}

/* Enhanced Gallery Transitions */
.innerPage_gallery-item {
    transition: transform 0.3s ease;
}

.innerPage_gallery-item:hover {
    transform: scale(1.02);
}

.innerPage_gallery-content {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Improved Navigation Hover States */
.main-menu ul li a {
    position: relative;
    transition: color 0.3s ease;
}

.main-menu ul li a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--clr-theme-primary);
    transition: width 0.3s ease;
}

.main-menu ul li:hover a::after,
.main-menu ul li.active a::after {
    width: 100%;
}

/* Enhanced Footer Links */
.footer-widget-list ul li a {
    transition: padding-left 0.3s ease, color 0.3s ease;
}

.footer-widget-list ul li:hover a {
    padding-left: 8px;
    color: var(--clr-theme-primary);
}

/* Better Loading States */
img[src] {
    opacity: 0;
    animation: fadeInImage 0.5s ease forwards;
}

img[src]:not([src=""]) {
    opacity: 1;
}

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

/* Enhanced Testimonial Cards */
.testimonial-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 15px;
    padding: 30px;
    background: #fff;
}

.testimonial-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Improved Responsive Spacing */
@media (max-width: 991px) {
    section {
        padding-top: 80px !important;
        padding-bottom: 60px !important;
    }
}

@media (max-width: 767px) {
    .section-title {
        font-size: 28px !important;
        line-height: 1.3 !important;
    }
    
    .section-text {
        font-size: 14px;
    }
}

/* Enhanced Breadcrumb */
.breadcrumb-area {
    position: relative;
    overflow: hidden;
}

.breadcrumb-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.2) 100%);
    z-index: 1;
}

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

/* Smooth Counter Animations (if used elsewhere) */
.counter-item {
    transition: transform 0.3s ease;
}

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

/* Enhanced CTA Section */
.cta-area {
    background: linear-gradient(135deg, var(--clr-theme-primary) 0%, #0056b3 100%);
    position: relative;
    overflow: hidden;
}

.cta-area::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

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

/* Improved Visual Polish for School Divisions */
.category-item[style*="height: 100%"] {
    display: flex;
    flex-direction: column;
}

.category-item[style*="height: 100%"] .category-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Enhanced Social Icons */
.footer-social ul li a {
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.footer-social ul li:hover a {
    transform: translateY(-3px) scale(1.1);
    background: var(--clr-theme-primary);
    color: #fff;
}

/* Better Visual Feedback for Interactive Elements */
a,
button,
.theme-btn {
    cursor: pointer;
}

a:active,
button:active,
.theme-btn:active {
    transform: translateY(1px);
}

/* Enhanced Header Sticky Behavior */
.header-sticky {
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.header-sticky.sticky {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

/* Improved Gallery Filter Tabs */
.innerPage_gallery-tab .nav-link {
    transition: all 0.3s ease;
    position: relative;
}

.innerPage_gallery-tab .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--clr-theme-primary);
    border-radius: 3px;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 767px) {
    .category-item,
    .event-item,
    .h2_blog-item {
        margin-bottom: 25px;
    }
    
    .section-area {
        margin-bottom: 40px !important;
    }
    
    .wow {
        animation-duration: 0.8s !important;
    }
}

/* Print Styles */
@media print {
    .header-area,
    .footer-area,
    .cta-area,
    .sidebar-info {
        display: none !important;
    }
}

