/* ============================================
   RESPONSIVE STYLES FOR PATOLINGO
   ============================================ */

/* Mobile First Approach */

/* Extra Small Devices (Phones, less than 576px) */
@media (max-width: 575.98px) {
    /* Typography */
    body {
        font-size: 14px;
    }
    
    h1, .h1 {
        font-size: 1.5rem !important;
    }
    
    h2, .h2 {
        font-size: 1.35rem !important;
    }
    
    h3, .h3 {
        font-size: 1.25rem !important;
    }
    
    /* Buttons */
    .btn {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }
    
    .btn-group > .btn {
        margin-bottom: 0.5rem;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        font-size: 0.95rem;
        padding: 0.75rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Tables */
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.4rem;
    }
    
    /* Forms */
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px; /* Better touch target */
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    /* Badges */
    .badge {
        font-size: 0.7rem;
        padding: 0.35em 0.5em;
    }
    
    /* Alerts */
    .alert {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    
    /* Spacing */
    .p-4 {
        padding: 1rem !important;
    }
    
    .mt-3, .my-3 {
        margin-top: 0.75rem !important;
    }
    
    .mb-3, .my-3 {
        margin-bottom: 0.75rem !important;
    }
}

/* Small Devices (Tablets, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    body {
        font-size: 15px;
    }
    
    h1, .h1 {
        font-size: 1.75rem !important;
    }
    
    .btn {
        font-size: 0.9rem;
    }
}

/* Medium Devices (Small Laptops, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* DataTables Responsive */
@media (max-width: 767.98px) {
    /* DataTables Controls */
    div.dataTables_wrapper div.dataTables_length,
    div.dataTables_wrapper div.dataTables_filter {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    div.dataTables_wrapper div.dataTables_length select {
        width: auto;
        display: inline-block;
    }
    
    div.dataTables_wrapper div.dataTables_filter input {
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    div.dataTables_wrapper div.dataTables_info,
    div.dataTables_wrapper div.dataTables_paginate {
        text-align: center;
        margin-top: 1rem;
    }
    
    div.dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.25rem 0.5rem;
        margin: 0 2px;
    }
    
    /* Table scroll hint */
    .table-responsive::after {
        content: "← Desliza para ver más →";
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: #6c757d;
        margin-top: 0.5rem;
        font-style: italic;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets */
    a, button, .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Checkbox and radio buttons */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
    }
    
    /* Better spacing for touch */
    .nav-link {
        padding: 0.75rem 1rem !important;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 767.98px) and (orientation: landscape) {
    .navbar-brand img {
        height: 25px;
    }
    
    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .card-header,
    .modal,
    .dataTables_length,
    .dataTables_filter,
    .dataTables_paginate {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .table {
        font-size: 10pt;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }
    
    .card {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .progress-bar {
        transition: none;
    }
}

/* Dark mode support (if implemented in future) */
@media (prefers-color-scheme: dark) {
    /* Placeholder for future dark mode styles */
}
