/* ============================================
   PROSYD ACADEMY - MOBILE RESPONSIVE STYLES
   Enhanced Mobile-First Design for All Screen Sizes
   ============================================ */

/* ============================================
   UTILITY CLASSES FOR MOBILE
   ============================================ */

.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .mobile-hidden {
        display: none !important;
    }
}

/* Touch-friendly elements */
.touch-target {
    min-height: 44px;
    min-width: 44px;
}

/* ============================================
   ENHANCED NAVIGATION FOR MOBILE
   ============================================ */

@media (max-width: 991px) {
    /* Hamburger Menu Enhancement */
    .navbar-toggler {
        border: 2px solid var(--primary-green);
        border-radius: 8px;
        padding: 8px 12px;
        transition: all 0.3s ease;
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(45, 80, 22, 0.25);
    }
    
    .navbar-toggler-icon {
        width: 24px;
        height: 24px;
    }
    
    /* Animated Menu Items */
    .navbar-collapse.collapsing,
    .navbar-collapse.show {
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Dropdown Mobile Optimization */
    .nav-item.dropdown .dropdown-menu {
        background: rgba(248, 249, 250, 0.95);
        border: none;
        margin-left: 15px;
        margin-top: 5px;
    }
    
    .dropdown-item {
        padding: 12px 20px;
        border-radius: 6px;
        margin: 2px 0;
    }
    
    .dropdown-item:hover {
        background: rgba(45, 80, 22, 0.1);
        transform: translateX(5px);
        transition: all 0.3s ease;
    }
}

/* ============================================
   FORM ENHANCEMENTS FOR MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Form Controls */
    .form-control,
    .form-select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        height: auto;
        min-height: 44px;
        border-radius: 10px;
    }
    
    .form-label {
        font-weight: 600;
        margin-bottom: 8px;
    }
    
    /* Input Groups */
    .input-group {
        flex-wrap: nowrap;
    }
    
    .input-group .btn {
        white-space: nowrap;
    }
    
    /* Checkbox and Radio */
    .form-check-input {
        width: 20px;
        height: 20px;
        margin-top: 0.25em;
    }
    
    .form-check-label {
        margin-left: 8px;
        line-height: 1.5;
    }
    
    /* File Upload */
    .form-control[type="file"] {
        padding: 10px;
    }
    
    /* Submit Buttons */
    .form-submit-btn {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
        font-weight: 600;
    }
}

/* ============================================
   TABLE RESPONSIVE ENHANCEMENTS
   ============================================ */

@media (max-width: 768px) {
    /* Stack table rows */
    .table-mobile-stack {
        border: 0;
    }
    
    .table-mobile-stack thead {
        display: none;
    }
    
    .table-mobile-stack tbody,
    .table-mobile-stack tr,
    .table-mobile-stack td {
        display: block;
        width: 100%;
    }
    
    .table-mobile-stack tr {
        margin-bottom: 20px;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    
    .table-mobile-stack td {
        text-align: right;
        padding: 12px 15px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .table-mobile-stack td:last-child {
        border-bottom: none;
    }
    
    .table-mobile-stack td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: var(--primary-green);
    }
    
    /* Horizontal scroll for complex tables */
    .table-scroll-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
    }
    
    .table-scroll-wrapper table {
        min-width: 600px;
    }
}

/* ============================================
   CARD LAYOUTS FOR MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Card Spacing */
    .card {
        margin-bottom: 20px;
        border-radius: 15px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }
    
    .card-body {
        padding: 20px;
    }
    
    .card-title {
        font-size: 1.25rem;
        margin-bottom: 15px;
    }
    
    /* Card Images */
    .card-img-top {
        border-radius: 15px 15px 0 0;
        height: 200px;
        object-fit: cover;
    }
    
    /* Horizontal Cards on Mobile */
    .card-horizontal {
        flex-direction: column;
    }
    
    .card-horizontal .card-img-left {
        width: 100%;
        height: 180px;
        border-radius: 15px 15px 0 0;
    }
}

/* ============================================
   MODAL OPTIMIZATIONS FOR MOBILE
   ============================================ */

@media (max-width: 768px) {
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-content {
        border-radius: 20px;
    }
    
    .modal-header {
        padding: 20px;
        border-radius: 20px 20px 0 0;
    }
    
    .modal-body {
        padding: 20px;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Full-screen modal option */
    .modal-fullscreen-mobile {
        max-width: 100%;
        margin: 0;
        height: 100%;
    }
    
    .modal-fullscreen-mobile .modal-content {
        height: 100%;
        border-radius: 0;
    }
}

/* ============================================
   HERO SECTION MOBILE OPTIMIZATION
   ============================================ */

@media (max-width: 768px) {
    .hero-section,
    .contact-hero,
    .page-hero {
        padding: 60px 0 40px;
    }
    
    .hero-content {
        text-align: center;
        padding: 0 15px;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .hero-description {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 25px;
    }
    
    .hero-image {
        margin-top: 30px;
    }
    
    .hero-image img {
        max-width: 100%;
        height: auto;
    }
}

/* ============================================
   GRID SYSTEM MOBILE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    /* Force single column on mobile */
    .row.mobile-single-col > [class*='col-'] {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
    
    /* Two columns on mobile */
    .row.mobile-two-col > [class*='col-'] {
        width: 50%;
        max-width: 50%;
        flex: 0 0 50%;
    }
}

/* ============================================
   SPACING UTILITIES FOR MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Section Padding */
    section {
        padding: 40px 0;
    }
    
    .py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    /* Margin Adjustments */
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .mt-5 {
        margin-top: 2rem !important;
    }
}

/* ============================================
   TYPOGRAPHY FOR MOBILE
   ============================================ */

@media (max-width: 768px) {
    body {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    h1 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.4rem;
        line-height: 1.4;
    }
    
    h4 {
        font-size: 1.2rem;
    }
    
    h5 {
        font-size: 1.1rem;
    }
    
    h6 {
        font-size: 1rem;
    }
    
    p {
        margin-bottom: 1rem;
    }
    
    /* Improve readability */
    .lead {
        font-size: 1.1rem;
    }
    
    small, .small {
        font-size: 0.85rem;
    }
}

/* ============================================
   BUTTONS AND CALLS-TO-ACTION MOBILE
   ============================================ */

@media (max-width: 768px) {
    .btn {
        padding: 12px 24px;
        font-size: 0.95rem;
        border-radius: 25px;
    }
    
    .btn-lg {
        padding: 14px 28px;
        font-size: 1rem;
    }
    
    .btn-sm {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    /* Button Groups */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        border-radius: 10px;
        margin-bottom: 10px;
    }
    
    /* Floating Action Button */
    .fab-mobile {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
    }
    
    .fab-mobile .btn {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
}

/* ============================================
   FOOTER MOBILE OPTIMIZATION
   ============================================ */

@media (max-width: 768px) {
    .footer {
        text-align: center;
    }
    
    .footer-widget {
        margin-bottom: 30px;
    }
    
    .footer-links {
        list-style: none;
        padding: 0;
    }
    
    .footer-links li {
        margin-bottom: 10px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
}

/* ============================================
   BREADCRUMB MOBILE
   ============================================ */

@media (max-width: 768px) {
    .breadcrumb {
        font-size: 0.85rem;
        padding: 10px 15px;
        margin-bottom: 20px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .breadcrumb-item {
        display: inline-block;
    }
}

/* ============================================
   PAGINATION MOBILE
   ============================================ */

@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-item {
        margin: 2px;
    }
    
    .page-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    /* Hide some pagination items on very small screens */
    .pagination .page-item:not(.active):not(.prev):not(.next) {
        display: none;
    }
    
    .pagination .page-item.active,
    .pagination .page-item.prev,
    .pagination .page-item.next {
        display: block;
    }
}

/* ============================================
   ALERTS AND NOTIFICATIONS MOBILE
   ============================================ */

@media (max-width: 768px) {
    .alert {
        font-size: 0.9rem;
        padding: 12px 15px;
        border-radius: 10px;
    }
    
    .toast {
        max-width: calc(100% - 30px);
        margin: 15px;
    }
}

/* ============================================
   LOADING AND SKELETON SCREENS
   ============================================ */

@media (max-width: 768px) {
    .skeleton {
        animation: skeleton-loading 1s linear infinite alternate;
    }
    
    @keyframes skeleton-loading {
        0% {
            background-color: hsl(200, 20%, 80%);
        }
        100% {
            background-color: hsl(200, 20%, 95%);
        }
    }
    
    .skeleton-text {
        width: 100%;
        height: 0.7rem;
        margin-bottom: 0.5rem;
        border-radius: 0.25rem;
    }
    
    .skeleton-title {
        width: 50%;
        height: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.25rem;
    }
}

/* ============================================
   TOUCH INTERACTIONS
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .btn:hover,
    .card:hover,
    .nav-link:hover {
        transform: none;
    }
    
    /* Add active/tap states */
    .btn:active,
    .card:active,
    .nav-link:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

@media (max-width: 768px) {
    /* Focus indicators */
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid var(--primary-green);
        outline-offset: 2px;
    }
    
    /* Skip to content link */
    .skip-to-content {
        position: absolute;
        top: -40px;
        left: 0;
        background: var(--primary-green);
        color: white;
        padding: 8px;
        text-decoration: none;
        z-index: 100;
    }
    
    .skip-to-content:focus {
        top: 0;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .navbar,
    .footer,
    .btn,
    .fab-mobile,
    .back-to-top,
    .call-to-action {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: black;
    }
}
