/* ===================================
   COMPREHENSIVE RESPONSIVE ENHANCEMENTS
   Specifically for Home Page & All Devices
   =================================== */

/* ===================================
   LAPTOP SCREENS (1024px - 1440px)
   =================================== */
@media (min-width: 1024px) and (max-width: 1440px) {
    .container {
        max-width: 1200px;
        padding: 0 var(--spacing-lg);
    }

    .logo {
        width: 80px;
        height: 80px;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xl);
    }

    .about-features {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ===================================
   TABLET SCREENS (768px - 1023px)
   =================================== */
@media (min-width: 768px) and (max-width: 1023px) {

    /* Container adjustments */
    .container {
        max-width: 100%;
        padding: 0 var(--spacing-md);
    }

    /* Hero Section */
    .hero {
        min-height: 70vh;
    }

    .hero-logo img {
        width: 120px;
        height: 120px;
    }

    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: row;
        gap: var(--spacing-md);
        justify-content: center;
    }

    .hero-buttons .btn {
        padding: var(--spacing-sm) var(--spacing-xl);
        font-size: 1rem;
    }

    /* Partnership Section */
    .partnership-content {
        gap: var(--spacing-lg);
    }

    .partner-logo img {
        height: 80px;
    }

    /* About Section */
    .section-title {
        font-size: 2.5rem;
    }

    .section-description {
        font-size: 1.1rem;
    }

    .about-features {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-lg);
    }

    .feature-card {
        padding: var(--spacing-lg);
    }

    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }

    /* Categories Section */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-lg);
    }

    .category-card {
        padding: var(--spacing-lg);
    }

    .category-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }

    /* Criteria Section */
    .criteria-list {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }

    .criteria-item {
        padding: var(--spacing-lg);
    }

    /* Registration Section */
    .registration-info {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-lg);
    }

    /* Contact Section */
    .contact-info {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-lg);
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-lg);
    }
}

/* ===================================
   MOBILE SCREENS (481px - 767px)
   =================================== */
@media (min-width: 481px) and (max-width: 767px) {

    /* Container */
    .container {
        padding: 0 var(--spacing-md);
    }

    /* Navigation */
    .nav-menu {
        gap: var(--spacing-sm);
    }

    /* Hero Section */
    .hero {
        min-height: 60vh;
        padding: var(--spacing-xl) 0;
    }

    .hero-logo img {
        width: 100px;
        height: 100px;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
        margin-bottom: var(--spacing-md);
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: var(--spacing-lg);
    }

    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .hero-buttons .btn {
        width: 100%;
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 0.95rem;
    }

    /* Partnership Section */
    .partnership-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .partner-logo img {
        height: 70px;
    }

    .partnership-text p {
        font-size: 1rem;
    }

    /* Section Spacing */
    .section {
        padding: var(--spacing-xl) 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-description {
        font-size: 1rem;
    }

    /* About Features */
    .about-features {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .feature-card {
        padding: var(--spacing-lg);
    }

    /* Categories Grid */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .category-card {
        padding: var(--spacing-lg);
    }

    .category-card h3 {
        font-size: 1.3rem;
    }

    /* Criteria Section */
    .criteria-list {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* Registration Info */
    .registration-info {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* Contact Info */
    .contact-info {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-lg);
    }
}

/* ===================================
   SMALL MOBILE SCREENS (320px - 480px)
   =================================== */
@media (max-width: 480px) {

    /* Container */
    .container {
        padding: 0 var(--spacing-sm);
    }

    /* Navigation */
    .navbar {
        padding: var(--spacing-xs) 0;
    }

    .nav-container {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .logo {
        width: 40px;
        height: 40px;
    }

    /* Hero Section */
    .hero {
        min-height: 550px;
        padding: var(--spacing-lg) 0;
    }

    .hero-content {
        padding: var(--spacing-sm);
    }

    .hero-logo img {
        width: 80px;
        height: 80px;
    }

    .hero-title {
        font-size: 1.5rem;
        line-height: 1.4;
        margin-bottom: var(--spacing-sm);
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: var(--spacing-md);
    }

    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-xs);
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
    }

    .scroll-indicator {
        bottom: var(--spacing-md);
    }

    /* Partnership Section */
    .partnership-section {
        padding: var(--spacing-lg) 0;
    }

    .partnership-content {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .partner-logo img {
        height: 60px;
    }

    .partnership-text p {
        font-size: 0.9rem;
    }

    /* Section Spacing */
    .section {
        padding: var(--spacing-lg) 0;
    }

    .section-header {
        margin-bottom: var(--spacing-lg);
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-sm);
    }

    .title-underline {
        width: 60px;
        height: 3px;
    }

    .section-description {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    /* About Features */
    .about-features {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .feature-card {
        padding: var(--spacing-md);
    }

    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: var(--spacing-sm);
    }

    .feature-card h4 {
        font-size: 1.1rem;
        margin-bottom: var(--spacing-xs);
    }

    .feature-card p {
        font-size: 0.85rem;
    }

    /* Categories Grid */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .category-card {
        padding: var(--spacing-md);
    }

    .category-badge {
        top: var(--spacing-xs);
        right: var(--spacing-xs);
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }

    .category-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: var(--spacing-sm);
    }

    .category-card h3 {
        font-size: 1.1rem;
        margin-bottom: var(--spacing-xs);
    }

    .category-card p {
        font-size: 0.85rem;
    }

    /* Criteria Section */
    .criteria-section {
        padding: var(--spacing-xl) 0;
    }

    .criteria-list {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .criteria-item {
        padding: var(--spacing-md);
    }

    .criteria-number {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        bottom: var(--spacing-xs);
        left: var(--spacing-xs);
    }

    .criteria-text h4 {
        font-size: 1rem;
        margin-bottom: var(--spacing-xs);
    }

    .criteria-text p {
        font-size: 0.85rem;
    }

    /* Registration Section */
    .registration-info {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .info-card {
        padding: var(--spacing-md);
    }

    .info-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: var(--spacing-sm);
    }

    .info-card h4 {
        font-size: 1.1rem;
        margin-bottom: var(--spacing-xs);
    }

    .info-card p {
        font-size: 0.85rem;
    }

    .registration-cta h3 {
        font-size: 1.3rem;
    }

    .registration-cta p {
        font-size: 0.9rem;
    }

    /* Contact Section */
    .contact-info {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .contact-card {
        padding: var(--spacing-md);
    }

    .contact-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: var(--spacing-sm);
    }

    .contact-card h4 {
        font-size: 1.1rem;
        margin-bottom: var(--spacing-xs);
    }

    .contact-card p {
        font-size: 0.85rem;
    }

    /* Footer */
    .footer {
        padding: var(--spacing-xl) 0 var(--spacing-md);
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-md);
    }

    .footer-logo img {
        width: 60px;
        margin: 0 auto var(--spacing-xs);
    }

    .footer-logo p {
        font-size: 0.9rem;
    }

    .footer-links h4,
    .footer-contact h4 {
        font-size: 1rem;
        margin-bottom: var(--spacing-sm);
    }

    .footer-links ul li,
    .footer-contact p {
        font-size: 0.85rem;
    }

    .footer-bottom {
        margin-top: var(--spacing-md);
        padding-top: var(--spacing-md);
    }

    .footer-bottom p {
        font-size: 0.8rem;
    }

    .footer-credit img {
        height: 25px !important;
    }

    /* Criteria Section Mobile Optimization */
    .criteria-list {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .criteria-item {
        padding: 15px !important;
        flex-direction: row !important;
        /* Keep side-by-side layout */
        align-items: center !important;
        text-align: right !important;
        gap: 15px !important;
    }

    .criteria-number {
        font-size: 1.8rem !important;
        min-width: 50px !important;
    }

    .criteria-text h4 {
        font-size: 1.1rem !important;
        margin-bottom: 5px !important;
    }

    .criteria-text p {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }

    /* Buttons */
    .btn,
    .btn-primary,
    .btn-secondary {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
    }

    .btn-large {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 0.95rem;
    }
}

/* ===================================
   EXTRA SMALL DEVICES (< 375px)
   =================================== */
@media (max-width: 374px) {
    .hero-title {
        font-size: 1.3rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .section-description {
        font-size: 0.85rem;
    }

    .btn,
    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

/* ===================================
   LANDSCAPE ORIENTATION FIXES
   =================================== */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: var(--spacing-md) 0;
    }

    .hero-logo img {
        width: 60px;
        height: 60px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .hero-buttons {
        margin-top: var(--spacing-sm);
    }

    .scroll-indicator {
        display: none;
    }
}

/* ===================================
   TOUCH DEVICE OPTIMIZATIONS
   =================================== */
@media (hover: none) and (pointer: coarse) {

    /* Increase tap targets for mobile */
    .btn,
    .nav-link,
    .category-card,
    .feature-card {
        min-height: 44px;
        /* iOS recommended minimum */
    }

    /* Remove hover effects on touch devices */
    .category-card:hover,
    .feature-card:hover,
    .criteria-item:hover {
        transform: none;
    }

    /* Add active states instead */
    .category-card:active,
    .feature-card:active {
        transform: scale(0.98);
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {

    .navbar,
    .menu-toggle,
    .scroll-indicator,
    .footer {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: var(--spacing-lg) 0;
    }

    .section {
        page-break-inside: avoid;
    }
}

/* ===================================
   ABOUT PAGE SPECIFIC MOBILE STYLES
   =================================== */
@media (max-width: 767px) {
    .about-page-intro .intro-card {
        padding: var(--spacing-lg) !important;
    }

    .vision-mission-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-md) !important;
    }

    .vm-card {
        padding: var(--spacing-md) !important;
    }

    .values-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-md) !important;
    }
}

/* ===================================
   REGISTRATION PAGE MOBILE FIXES
   =================================== */
@media (max-width: 767px) {

    /* Page Header on Mobile */
    .page-header {
        padding: calc(60px + var(--spacing-lg)) 0 var(--spacing-lg) !important;
        min-height: auto !important;
    }

    .page-header h1 {
        font-size: 1.8rem !important;
        line-height: 1.3 !important;
    }

    .page-header p {
        font-size: 1rem !important;
    }

    /* Registration Info Section */
    .registration-info-section {
        padding: var(--spacing-lg) 0 !important;
    }

    .registration-info {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-sm) !important;
    }

    .info-card {
        padding: var(--spacing-md) !important;
    }

    /* Form Section */
    .form-section {
        padding: var(--spacing-lg) 0 !important;
    }

    .registration-form-container {
        padding: var(--spacing-md) !important;
    }

    .form-section-title {
        margin: var(--spacing-lg) 0 var(--spacing-md) !important;
    }

    .form-section-title h3 {
        font-size: 1.2rem !important;
    }

    .form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .form-group {
        margin-bottom: var(--spacing-md) !important;
    }

    .form-group label {
        font-size: 0.95rem !important;
        margin-bottom: var(--spacing-xs) !important;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important;
        /* Prevents zoom on iOS */
        padding: var(--spacing-sm) !important;
    }

    .form-group textarea {
        min-height: 150px !important;
    }

    /* File Upload Styling */
    .form-group input[type="file"] {
        padding: var(--spacing-xs) !important;
        font-size: 0.9rem !important;
    }

    .form-group small {
        font-size: 0.85rem !important;
        display: block !important;
        margin-top: var(--spacing-xs) !important;
    }

    /* Checkbox Group */
    .checkbox-group {
        padding: var(--spacing-md) !important;
    }

    .checkbox-label {
        font-size: 0.9rem !important;
        line-height: 1.6 !important;
    }

    .checkbox-label input[type="checkbox"] {
        width: 20px !important;
        height: 20px !important;
        margin-left: var(--spacing-xs) !important;
    }

    /* Submit Button */
    .registration-form .btn-large {
        width: 100% !important;
        padding: var(--spacing-md) !important;
        font-size: 1.1rem !important;
    }

    /* Section Header */
    .form-section .section-header {
        margin-bottom: var(--spacing-lg) !important;
    }

    .form-section .section-title {
        font-size: 1.8rem !important;
    }

    .form-section .section-description {
        font-size: 0.95rem !important;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .page-header {
        padding: calc(60px + var(--spacing-md)) 0 var(--spacing-md) !important;
    }

    .page-header h1 {
        font-size: 1.5rem !important;
    }

    .page-header p {
        font-size: 0.9rem !important;
    }

    .info-card {
        padding: var(--spacing-sm) !important;
    }

    .info-card h4 {
        font-size: 1rem !important;
    }

    .info-card p {
        font-size: 0.85rem !important;
    }

    .registration-form-container {
        padding: var(--spacing-sm) !important;
    }

    .form-section-title h3 {
        font-size: 1.1rem !important;
    }

    .form-group label {
        font-size: 0.9rem !important;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important;
        padding: 12px !important;
    }
}

/* ===================================
   RESPONSIVE TABLES (CARD VIEW)
   =================================== */
@media (max-width: 768px) {
    .table-responsive {
        border: none !important;
        overflow: visible !important;
    }

    /* ONLY apply card view to the specific fields-table */
    .fields-table {
        display: block !important;
        width: 100% !important;
    }

    .fields-table thead {
        display: none !important;
        /* Hide headers */
    }

    .fields-table tbody {
        display: block !important;
        width: 100% !important;
    }

    .fields-table tr {
        display: flex !important;
        flex-direction: column !important;
        background: #fff !important;
        border-radius: 10px !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
        margin-bottom: 20px !important;
        padding: 20px !important;
        border: 1px solid #eee !important;
    }

    .fields-table td {
        display: block !important;
        text-align: right !important;
        padding: 5px 0 !important;
        border: none !important;
        background: transparent !important;
    }

    /* Style the Number Column */
    .fields-table td:nth-child(1) {
        font-weight: 900 !important;
        color: var(--secondary-gold) !important;
        font-size: 1.2rem !important;
        border-bottom: 1px solid #eee !important;
        padding-bottom: 10px !important;
        margin-bottom: 10px !important;
    }

    .fields-table td:nth-child(1)::after {
        content: " .";
    }

    /* Style the Title/Axis Column */
    .fields-table td:nth-child(2) {
        font-weight: 700 !important;
        color: var(--primary-green) !important;
        font-size: 1.1rem !important;
        margin-bottom: 5px !important;
    }

    /* Style the Description Column */
    .fields-table td:nth-child(3) {
        color: #555 !important;
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }
}