/* ============================================
   COMPREHENSIVE RESPONSIVENESS & POLISH
   Mobile, Tablet, Desktop optimizations
   ============================================ */

/* ============================================
   NOTICE TICKER RESPONSIVENESS ENHANCEMENTS
   ============================================ */

@media (max-width: 1200px) {
    .notice-ticker-wrapper {
        gap: var(--spacing-sm);
    }
}

@media (max-width: 1024px) {
    .notice-ticker-container {
        top: 90px;
    }
    
    .notice-ticker-label {
        padding: 0.5rem var(--spacing-md);
    }
    
    .ticker-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .notice-ticker-container {
        top: 85px;
        padding: 0 var(--spacing-sm);
    }
    
    .notice-ticker-wrapper {
        padding: var(--spacing-sm) var(--spacing-md);
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
    }
    
    .notice-ticker-label {
        flex-shrink: 0;
        padding: 0.4rem var(--spacing-sm);
    }
    
    .ticker-icon {
        font-size: 1rem;
    }
    
    .ticker-text {
        font-size: 0.75rem;
    }
    
    .notice-ticker-content {
        flex: 1;
        min-width: 0;
    }
    
    .notice-close-btn {
        position: relative;
        right: 0;
        top: 0;
        transform: none;
        margin-left: var(--spacing-sm);
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        flex-shrink: 0;
    }
    
    .notice-close-btn:hover {
        transform: rotate(90deg) scale(1.1);
    }
    
    .notice-close-btn:active {
        transform: rotate(90deg) scale(0.95);
    }
    
    .notice-close-btn span {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .notice-ticker-container {
        top: 80px;
    }
    
    .notice-ticker-wrapper {
        padding: var(--spacing-sm);
        gap: 0.375rem;
    }
    
    .notice-ticker-label {
        padding: 0.35rem 0.5rem;
    }
    
    .ticker-icon {
        font-size: 0.875rem;
    }
    
    .ticker-text {
        font-size: 0.7rem;
    }
    
    .notice-text {
        font-size: 0.75rem;
    }
    
    .notice-close-btn {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
    }
    
    .notice-close-btn span {
        font-size: 0.875rem;
    }
}

/* ============================================
   NAVIGATION BAR RESPONSIVENESS
   ============================================ */

@media (max-width: 1024px) {
    .navbar {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .nav-logo {
        gap: 0.5rem;
    }
    
    .logo-img {
        width: 42px;
        height: 42px;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        top: var(--spacing-md);
        width: calc(100% - var(--spacing-lg));
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .logo-img {
        width: 38px;
        height: 38px;
    }
    
    .logo-text {
        font-size: 1.125rem;
    }
    
    /* Mobile menu button enhancements */
    .mobile-menu-btn {
        padding: 0.5rem;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-menu-btn span {
        width: 22px;
    }
}

@media (max-width: 480px) {
    .navbar {
        top: var(--spacing-sm);
        width: calc(100% - var(--spacing-md));
        padding: 0.5rem var(--spacing-md);
    }
    
    .logo-img {
        width: 34px;
        height: 34px;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .mobile-menu-btn {
        width: 36px;
        height: 36px;
    }
    
    .mobile-menu-btn span {
        width: 20px;
    }
}

/* ============================================
   THEME TOGGLE POLISH & ACCESSIBILITY
   ============================================ */

/* Ensure theme toggle doesn't overlap with other elements */
.theme-toggle {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus styles for accessibility */
.theme-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

/* Touch-friendly sizing on mobile */
@media (max-width: 768px) {
    .theme-toggle {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .theme-icon {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .theme-toggle {
        bottom: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .theme-icon {
        font-size: 1.125rem;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 896px) and (orientation: landscape) {
    .theme-toggle {
        bottom: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .theme-icon {
        font-size: 1rem;
    }
}

/* ============================================
   HERO SECTION RESPONSIVENESS
   ============================================ */

@media (max-width: 1024px) {
    .hero-badge {
        padding: 0.5rem 1rem;
    }
    
    .badge-text {
        font-size: 0.8rem;
    }
    
    .hero-title {
        font-size: clamp(2rem, 4vw, 3rem);
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding-top: 80px;
        min-height: auto;
    }
    
    .hero-content {
        padding-top: 1rem;
    }
    
    .hero-badge {
        margin-bottom: 1.5rem;
        font-size: 0.75rem;
    }
    
    .badge-icon {
        font-size: 1rem;
    }
    
    .hero-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-md);
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding-top: 70px;
    }
    
    .hero-badge {
        padding: 0.4rem 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
    
    .badge-text {
        font-size: 0.7rem;
        line-height: 1.3;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-description {
        font-size: 0.875rem;
    }
}

/* ============================================
   BUTTONS RESPONSIVENESS
   ============================================ */

@media (max-width: 768px) {
    .btn {
        font-size: 0.95rem;
        padding: var(--spacing-sm) var(--spacing-lg);
    }
    
    .btn-large {
        font-size: 1rem;
        padding: var(--spacing-md) var(--spacing-xl);
    }
    
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.3rem var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .btn {
        font-size: 0.875rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .btn-large {
        font-size: 0.95rem;
        padding: var(--spacing-sm) var(--spacing-lg);
    }
}

/* ============================================
   SECTIONS & CARDS RESPONSIVENESS
   ============================================ */

@media (max-width: 1024px) {
    .section-title {
        font-size: 2.25rem;
    }
    
    .section-subtitle {
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    .features-section,
    .download-section,
    .about-section,
    .academics-section,
    .contact-section {
        padding: var(--spacing-xl) 0;
        margin: var(--spacing-xl) 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .section-header {
        margin-bottom: var(--spacing-xl);
    }
    
    .feature-card,
    .download-card,
    .contact-card {
        padding: var(--spacing-lg);
    }
    
    .feature-icon,
    .download-icon,
    .contact-icon {
        font-size: 2.5rem;
        margin-bottom: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .features-section,
    .download-section,
    .about-section,
    .academics-section,
    .contact-section {
        padding: var(--spacing-lg) 0;
        margin: var(--spacing-lg) 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: 0.95rem;
    }
    
    .feature-card,
    .download-card,
    .contact-card {
        padding: var(--spacing-md);
    }
    
    .feature-card h3,
    .download-card h3,
    .contact-card h3 {
        font-size: 1.125rem;
    }
    
    .feature-card p,
    .download-card p,
    .contact-card p {
        font-size: 0.9rem;
    }
}

/* ============================================
   FOOTER RESPONSIVENESS
   ============================================ */

@media (max-width: 768px) {
    .footer {
        padding: var(--spacing-xl) 0 var(--spacing-md);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .footer-section h4 {
        font-size: 1rem;
    }
    
    .footer-section a,
    .footer-section p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .footer-bottom {
        font-size: 0.85rem;
    }
}

/* ============================================
   SMOOTH TRANSITIONS & ANIMATIONS
   ============================================ */

/* Ensure smooth transitions for all interactive elements */
button,
.btn,
.nav-link,
.theme-toggle,
.notice-close-btn,
.feature-card,
.download-card,
.contact-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent janky animations on mobile */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Reduce animation complexity on mobile for performance */
    .hover-lift:hover {
        transform: translateY(-4px);
    }
    
    .hover-tilt:hover {
        transform: none;
    }
}

/* ============================================
   TOUCH-FRIENDLY ENHANCEMENTS
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    /* Touch device optimizations */
    .btn,
    .nav-link,
    .theme-toggle,
    .notice-close-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .hover-lift:hover,
    .hover-tilt:hover {
        transform: none;
    }
    
    /* Add active states instead */
    .btn:active {
        transform: scale(0.97);
    }
    
    .feature-card:active,
    .download-card:active,
    .contact-card:active {
        transform: scale(0.98);
    }
}

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

/* Focus styles for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn:focus-visible,
.nav-link:focus-visible {
    outline-width: 3px;
    outline-offset: 3px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: var(--spacing-md);
    z-index: 10000;
    text-decoration: none;
}

.skip-to-main:focus {
    top: 0;
}

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

@media print {
    .navbar,
    .theme-toggle,
    .notice-ticker-container,
    .mobile-menu-btn,
    .bg-animation {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .glass-card {
        background: white;
        border: 1px solid #ccc;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */

@media (prefers-contrast: high) {
    .glass-card {
        border-width: 2px;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .theme-toggle {
        border-width: 2px;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .navbar,
    .navbar.navbar-hidden,
    .navbar.navbar-visible {
        transition: none !important;
    }
    
    .theme-icon {
        transition: none !important;
    }
    
    .notice-item.active {
        animation: none !important;
        position: static !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* ============================================
   DARK MODE SPECIFIC FIXES
   ============================================ */

body:not(.light-theme) {
    /* Ensure proper contrast in dark mode */
}

body:not(.light-theme) .notice-ticker-wrapper {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body:not(.light-theme) .theme-toggle {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ============================================
   LIGHT MODE SPECIFIC FIXES
   ============================================ */

body.light-theme .notice-ticker-wrapper {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

body.light-theme .theme-toggle {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body.light-theme .navbar {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ============================================
   LANDSCAPE MOBILE ADJUSTMENTS
   ============================================ */

@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 60px 0 40px;
    }
    
    .hero-content {
        padding-top: 0;
    }
    
    .hero-badge {
        margin-bottom: 1rem;
    }
    
    .hero-title {
        margin-bottom: 0.75rem;
    }
    
    .hero-description {
        margin-bottom: 1rem;
    }
    
    .hero-buttons {
        margin-bottom: 1rem;
    }
    
    .hero-stats {
        gap: var(--spacing-sm);
    }
    
    .notice-ticker-container {
        top: 70px;
    }
}

/* ============================================
   VERY LARGE SCREENS
   ============================================ */

@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
    
    .navbar {
        max-width: 1400px;
    }
    
    .section-title {
        font-size: 3rem;
    }
    
    .hero-title {
        font-size: clamp(3rem, 5vw, 4.5rem);
    }
}

/* ============================================
   VERY SMALL SCREENS (320px)
   ============================================ */

@media (max-width: 360px) {
    .navbar {
        width: calc(100% - 1rem);
        padding: 0.4rem 0.75rem;
    }
    
    .logo-img {
        width: 30px;
        height: 30px;
    }
    
    .logo-text {
        font-size: 0.9rem;
    }
    
    .hero-title {
        font-size: 1.35rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .hero-description {
        font-size: 0.8rem;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        bottom: 10px;
        right: 10px;
    }
    
    .theme-icon {
        font-size: 1rem;
    }
    
    .notice-ticker-wrapper {
        padding: 0.4rem;
    }
    
    .notice-close-btn {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
    }
    
    .notice-close-btn span {
        font-size: 0.75rem;
    }
}
