/**
 * Responsive Styles
 * Charuchandra College Website
 * 
 * This file contains all responsive styles and media queries
 * for different screen sizes and devices.
 */

/* ==========================================================================
   BREAKPOINT SYSTEM
   ========================================================================== */

/*
 * Breakpoints:
 * - xs: 0-575px (mobile phones)
 * - sm: 576-767px (large mobile phones)
 * - md: 768-991px (tablets)
 * - lg: 992-1199px (desktops)
 * - xl: 1200-1399px (large desktops)
 * - xxl: 1400px+ (extra large desktops)
 */

/* ==========================================================================
   LARGE DESKTOP STYLES (1200px+)
   ========================================================================== */

@media (max-width: 1200px) {
    /* Services Grid */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    /* Statistics Grid */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
    
    /* Gallery Grid */
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .gallery-item {
        height: 260px;
    }
}

/* ==========================================================================
   DESKTOP STYLES (992px-1199px)
   ========================================================================== */

@media (max-width: 992px) {
    /* Carousel */
    .carousel-control-prev,
    .carousel-control-next {
        width: 8%;
    }
    
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 30px;
        height: 30px;
    }
    
    .carousel-indicators [data-bs-target] {
        width: 10px;
        height: 10px;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* Statistics */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px 12px;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .gallery-item {
        height: 240px;
    }
    
    .gallery-title h2 {
        font-size: 2.8rem;
    }
    
    .filter-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    /* Mobile Dropdown Fixes */
    .dropdown-submenu .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: rgba(0,0,0,0.1);
        border: 0;
        box-shadow: none;
        display: none;
    }
    
    .dropdown-submenu .dropdown-item {
        padding-left: 2rem;
    }
    
    .dropdown-submenu .dropdown-submenu .dropdown-item {
        padding-left: 3rem;
    }
}

/* ==========================================================================
   TABLET STYLES (768px-991px)
   ========================================================================== */

@media (max-width: 991px) and (min-width: 769px) {
    /* Login Section */
    .login-section {
        gap: 10px;
    }
    
    .login-box {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* Flash News */
    .flash-news-container {
        gap: 15px;
    }
    
    .flash-news-item {
        font-size: 13px;
        margin-right: 60px;
    }
    
    /* Service Cards */
    .service-card {
        padding: 30px 20px;
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 26px;
        margin-bottom: 20px;
    }
    
    .service-title {
        font-size: 1.15rem;
    }
}

/* ==========================================================================
   TABLET STYLES (768px and below)
   ========================================================================== */

@media (max-width: 768px) {
    /* General Layout */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Carousel */
    .carousel-caption h2 {
        font-size: 28px;
    }
    
    .carousel-caption p {
        font-size: 16px;
    }
    
    .hero-carousel {
        height: 60vh;
        min-height: 400px;
    }
    
    .carousel-item {
        height: 60vh;
        min-height: 400px;
    }
    
    /* Header */
    .college-info h1 {
        font-size: 24px;
    }
    
    /* Flash News Mobile */
    .flash-news-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .flash-news-label {
        font-size: 12px;
        padding: 6px 16px;
    }
    
    .flash-news-controls {
        display: none;
    }
    
    .flash-news-item {
        font-size: 13px;
        margin-right: 80px;
    }
    
    .flash-news-date {
        font-size: 10px;
    }
    
    /* Mobile Login Boxes */
    .login-section {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    
    .login-box {
        padding: 10px 16px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }
    
    /* Statistics */
    .stats-section {
        padding: 60px 0;
    }
    
    .stats-header {
        margin-bottom: 40px;
    }
    
    .stats-header h2 {
        font-size: 2rem;
    }
    
    .stats-header p {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 18px 10px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .stat-number {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    /* Services */
    .services-header h2 {
        font-size: 2.2rem;
    }
    
    .service-card {
        padding: 25px 20px;
        margin-bottom: 15px;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .service-title {
        font-size: 1.1rem;
    }
    
    /* Message Cards */
    .message-card, .principal-message-card {
        padding: 30px 25px;
        margin-bottom: 25px;
    }
    
    .message-icon {
        width: 80px;
        height: 80px;
        font-size: 28px;
        margin-bottom: 20px;
    }
    
    .message-card h5 {
        font-size: 1.5rem;
    }
    
    .message-card p {
        font-size: 0.95rem;
        padding: 0 10px;
    }
    
    .principal-image {
        width: 100px;
        height: 100px;
    }
    
    .principal-title {
        font-size: 1.4rem;
    }
    
    .principal-info {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .principal-signature {
        text-align: center;
    }
    
    /* Notice Cards */
    .notice-card {
        margin-bottom: 20px;
    }
    
    .notice-header {
        padding: 15px;
    }
    
    .notice-header h5 {
        font-size: 1rem;
    }
    
    .notice-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .notice-content {
        padding: 15px;
        height: auto;
        max-height: 250px;
    }
    
    .notice-item-compact {
        padding: 10px 0;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .notice-date-compact {
        font-size: 10px;
        padding: 4px 8px;
        min-width: auto;
        align-self: flex-start;
    }
    
    .notice-text {
        font-size: 12px;
    }
    
    .seminar-thumb {
        height: 100px;
    }
    
    .seminar-title {
        font-size: 14px;
    }
    
    .seminar-subtitle {
        font-size: 12px;
    }
    
    .notice-footer {
        padding: 12px 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .view-all-btn {
        padding: 6px 16px;
        font-size: 12px;
    }
    
    .notice-board-header h2 {
        font-size: 2.5rem;
    }
    
    .notice-board-header h2::before {
        left: -40px;
        font-size: 2rem;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .gallery-item {
        height: 200px;
        border-radius: var(--radius-2xl);
    }
    
    .gallery-title h2 {
        font-size: 2.2rem;
    }
    
    .gallery-title p {
        font-size: 1rem;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .gallery-content h6 {
        font-size: 1.1rem;
    }
    
    .gallery-content p {
        font-size: 0.9rem;
    }
    
    /* Footer */
    .footer {
        padding: 40px 0 0;
    }
    
    .footer-section {
        margin-bottom: 30px;
    }
    
    .footer h5 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .map-container iframe {
        height: 200px;
    }
    
    .contact-info li {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ==========================================================================
   MOBILE STYLES (576px and below)
   ========================================================================== */

@media (max-width: 576px) {
    /* Carousel */
    .hero-carousel {
        height: 50vh;
        min-height: 350px;
    }
    
    .carousel-item {
        height: 50vh;
        min-height: 350px;
    }
    
    .carousel-caption h2 {
        font-size: 24px;
    }
    
    .carousel-caption p {
        font-size: 14px;
    }
    
    .carousel-caption {
        width: 95%;
    }
    
    /* Header */
    .college-logo {
        width: 60px;
        height: 60px;
    }
    
    .college-info h1 {
        font-size: 20px;
    }
    
    /* Flash News Very Small Screens */
    .flash-news-section {
        padding: 8px 0;
    }
    
    .flash-news-label {
        font-size: 11px;
        padding: 5px 12px;
    }
    
    .flash-news-item {
        font-size: 12px;
        margin-right: 60px;
    }
    
    @keyframes scroll-news {
        0% { transform: translateX(120%) translateY(-50%); }
        100% { transform: translateX(-120%) translateY(-50%); }
    }
    
    /* Login Boxes */
    .login-box {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .login-box i {
        font-size: 14px;
    }
    
    /* Statistics */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px 8px;
    }
    
    .stat-icon {
        width: 35px;
        height: 35px;
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* Services */
    .quick-links-section {
        padding: 60px 0;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .service-card {
        padding: 20px 15px;
    }
    
    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .service-title {
        font-size: 1rem;
    }
    
    /* Message Cards */
    .message-card, .principal-message-card {
        padding: 25px 20px;
    }
    
    .message-card h5 {
        font-size: 1.3rem;
    }
    
    .message-card p {
        font-size: 0.9rem;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery-item {
        height: 250px;
    }
    
    .gallery-section {
        padding: 60px 0;
    }
    
    .gallery-title {
        margin-bottom: 50px;
    }
    
    .btn-view-more {
        padding: 15px 35px;
        font-size: 1rem;
    }
    
    /* Footer */
    .footer {
        padding: 30px 0 0;
    }
    
    .footer-section {
        margin-bottom: 25px;
    }
    
    .social-links a {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .directions-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .map-container iframe {
        height: 180px;
    }
}

/* ==========================================================================
   EXTRA SMALL MOBILE STYLES (480px and below)
   ========================================================================== */

@media (max-width: 480px) {
    /* Typography */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.2rem; }
    h4, h5, h6 { font-size: 1.1rem; }
    
    /* Carousel */
    .carousel-caption h2 {
        font-size: 20px;
    }
    
    .carousel-caption p {
        font-size: 12px;
    }
    
    /* Buttons */
    .btn-custom {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Cards */
    .service-card,
    .message-card,
    .stat-card,
    .notice-card {
        margin-bottom: 15px;
    }
    
    /* Text */
    .lead {
        font-size: 1rem;
    }
    
    /* Sections */
    .quick-links-section,
    .stats-section,
    .gallery-section,
    .notice-board-section {
        padding: 40px 0;
    }
}

/* ==========================================================================
   LANDSCAPE MOBILE STYLES
   ========================================================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .hero-carousel {
        height: 100vh;
        min-height: 400px;
    }
    
    .carousel-item {
        height: 100vh;
        min-height: 400px;
    }
    
    .carousel-caption h2 {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .carousel-caption p {
        font-size: 14px;
        margin-bottom: 15px;
    }
}

/* ==========================================================================
   HIGH RESOLUTION SCREENS
   ========================================================================== */

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    /* Increase font sizes for larger screens */
    .services-header h2 {
        font-size: 3.5rem;
    }
    
    .stats-header h2 {
        font-size: 3.5rem;
    }
    
    .gallery-title h2 {
        font-size: 4rem;
    }
    
    .notice-board-header h2 {
        font-size: 3.8rem;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    /* Hide non-essential elements */
    .flash-news-section,
    .login-section,
    .quick-links,
    .social-links,
    .notice-footer,
    .carousel-control-prev,
    .carousel-control-next,
    .carousel-indicators,
    .gallery-filters,
    .btn-view-more {
        display: none !important;
    }
    
    /* Basic layout for print */
    .container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Ensure text is readable */
    body {
        font-size: 12pt !important;
        line-height: 1.4 !important;
        color: black !important;
    }
    
    /* Page breaks */
    .notice-board-section,
    .stats-section,
    .gallery-section {
        page-break-inside: avoid;
    }
    
    /* Simplify cards for print */
    .service-card,
    .message-card,
    .stat-card,
    .notice-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        background: white !important;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .flash-news-ticker {
        animation: none !important;
    }
    
    .carousel-item {
        transition: none !important;
    }
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
    .service-card,
    .message-card,
    .stat-card,
    .notice-card {
        border: 2px solid currentColor !important;
    }
    
    .btn-custom,
    .login-box,
    .view-all-btn {
        border: 2px solid currentColor !important;
    }
}

/* ==========================================================================
   HOVER SUPPORT
   ========================================================================== */

/* Only apply hover effects on devices that support hover */
@media (hover: hover) {
    .service-card:hover,
    .message-card:hover,
    .stat-card:hover,
    .notice-card:hover,
    .gallery-item:hover {
        /* Hover effects are already defined in components.css */
    }
}

/* For touch devices, remove hover effects */
@media (hover: none) {
    .service-card:hover,
    .message-card:hover,
    .stat-card:hover,
    .notice-card:hover,
    .gallery-item:hover {
        transform: none !important;
        box-shadow: var(--shadow-lg) !important;
    }
}