/* ==================== RESPONSIVE DESIGN ==================== */
/* Mobile-first approach với breakpoints chuẩn */

/* Breakpoints chuẩn:
   - Desktop Large: > 1440px
   - Desktop: 1024px - 1440px  
   - Tablet Landscape: 768px - 1024px
   - Tablet Portrait / Mobile Landscape: 576px - 768px
   - Mobile: 375px - 576px
   - Mobile Small: < 375px
*/

/* NOTE: Header và Home page có responsive riêng trong file của chúng */
/* File này chỉ chứa responsive cho các component khác */

/* ==================== HOME PAGE RESPONSIVE ==================== */

/* Tablet */
@media (max-width: 992px) {
    .hero-title {
        font-size: 48px;
    }

    .hero-description {
        font-size: 24px;
    }

    .hero-banner {
        height: 400px;
    }

    .section-title {
        font-size: 36px;
    }

    .section-subtitle {
        font-size: 20px;
    }

    .intro-content {
        padding: 40px 20px;
    }

    .intro-title {
        font-size: 36px;
    }

    .intro-text {
        font-size: 16px;
    }

    .vision-mission-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .video-section {
        padding: 60px 20px;
    }

    .video-wrapper {
        max-width: 100%;
        padding: 0 15px;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .hero-title {
        font-size: 32px;
        margin-bottom: 16px;
    }

    .hero-description {
        font-size: 18px;
    }

    .hero-banner {
        height: 300px;
    }

    .section-title {
        font-size: 28px;
    }

    .section-subtitle {
        font-size: 16px;
    }

    .intro-content {
        padding: 30px 15px;
    }

    .intro-title {
        font-size: 28px;
    }

    .intro-text {
        font-size: 14px;
        line-height: 1.6;
    }

    .vm-card {
        padding: 30px 20px;
    }

    .vm-title {
        font-size: 24px;
    }

    .vm-text {
        font-size: 14px;
    }

    .scroll-to-top {
        width: 45px;
        height: 45px;
        font-size: 18px;
        right: 15px;
        bottom: 15px;
    }
}

/* ==================== EXPLORE PAGE RESPONSIVE ==================== */

@media (max-width: 992px) {
    .explore-container {
        padding: 40px 20px;
    }

    .explore-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .filter-bar {
        flex-direction: column;
        gap: 15px;
    }

    .search-box {
        width: 100%;
    }

    .category-filters {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .explore-container {
        padding: 30px 15px;
    }

    .explore-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        max-width: 100%;
    }

    .page-title {
        font-size: 28px;
    }

    .category-filter-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
}

/* ==================== CONTACT PAGE RESPONSIVE ==================== */

@media (max-width: 992px) {
    .contact-container {
        padding: 40px 20px;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-info {
        order: 2;
    }

    .contact-form-wrapper {
        order: 1;
    }
}

@media (max-width: 576px) {
    .contact-container {
        padding: 30px 15px;
    }

    .contact-title {
        font-size: 28px;
    }

    .contact-form .form-group {
        margin-bottom: 20px;
    }

    .contact-form input,
    .contact-form textarea {
        font-size: 14px;
        padding: 12px;
    }

    .info-card {
        padding: 20px;
    }

    .info-title {
        font-size: 16px;
    }

    .info-text {
        font-size: 14px;
    }
}

/* ==================== PROFILE PAGE RESPONSIVE ==================== */

@media (max-width: 992px) {
    .profile-container {
        padding: 40px 20px;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .avatar-upload {
        margin-right: 0;
        margin-bottom: 20px;
    }

    .profile-tabs {
        flex-wrap: wrap;
        gap: 10px;
    }

    .tab-btn {
        flex: 1 1 calc(50% - 10px);
        min-width: 120px;
    }
}

@media (max-width: 576px) {
    .profile-container {
        padding: 30px 15px;
    }

    .profile-content {
        padding: 25px 15px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-input {
        font-size: 14px;
        padding: 12px;
    }

    .btn-primary,
    .btn-secondary {
        font-size: 14px;
        padding: 12px 24px;
    }

    .tab-btn {
        font-size: 14px;
        padding: 10px 16px;
    }
}

/* ==================== AUTH PAGES RESPONSIVE ==================== */

@media (max-width: 992px) {
    .auth-container {
        grid-template-columns: 1fr;
    }

    .auth-image {
        display: none;
        /* Ẩn hình ảnh trên tablet/mobile */
    }

    .auth-form-container {
        padding: 40px 30px;
    }
}

@media (max-width: 576px) {
    .auth-form-container {
        padding: 30px 20px;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-subtitle {
        font-size: 14px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-input {
        font-size: 14px;
        padding: 12px;
    }

    .btn-auth {
        font-size: 15px;
        padding: 12px;
    }

    .social-login {
        gap: 10px;
    }

    .social-btn {
        font-size: 13px;
        padding: 10px 16px;
    }
}

/* ==================== POST DETAIL RESPONSIVE ==================== */

@media (max-width: 992px) {
    .post-container {
        padding: 40px 20px;
    }

    .post-header {
        padding: 30px 20px;
    }

    .post-title {
        font-size: 32px;
    }

    .post-content {
        padding: 30px 20px;
        font-size: 15px;
    }

    .timeline-navigation {
        display: none;
        /* Ẩn timeline trên tablet/mobile */
    }
}

@media (max-width: 576px) {
    .post-container {
        padding: 30px 15px;
    }

    .post-header {
        padding: 20px 15px;
    }

    .post-title {
        font-size: 24px;
    }

    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .post-content {
        padding: 20px 15px;
        font-size: 14px;
    }

    .post-content img {
        max-height: 300px;
    }

    .comment-section {
        padding: 20px 15px;
    }

    .comment-item {
        padding: 15px;
    }

    .comment-avatar {
        width: 35px;
        height: 35px;
    }

    .comment-author {
        font-size: 14px;
    }

    .comment-text {
        font-size: 13px;
    }
}

/* ==================== FOOTER RESPONSIVE ==================== */

@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .footer-brand {
        grid-column: 1 / -1;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-section {
        text-align: center;
    }

    .footer-title {
        font-size: 16px;
    }

    .footer-text,
    .footer-link {
        font-size: 13px;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        padding: 15px;
        font-size: 12px;
    }
}

/* ==================== UTILITY CLASSES RESPONSIVE ==================== */

/* Container padding */
@media (max-width: 992px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Hide on mobile */
.hide-mobile {
    display: block;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .show-mobile {
        display: block !important;
    }
}

/* Text alignment responsive */
@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center !important;
    }
}

/* Spacing responsive */
@media (max-width: 768px) {
    .p-mobile-sm {
        padding: 15px !important;
    }

    .m-mobile-sm {
        margin: 15px !important;
    }
}

/* ==================== TABLES RESPONSIVE ==================== */

@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }
}

/* ==================== FORMS RESPONSIVE ==================== */

@media (max-width: 576px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .form-row .form-group {
        width: 100%;
    }

    select,
    input[type="date"],
    input[type="time"] {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }
}

/* ==================== MODALS RESPONSIVE ==================== */

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
        padding: 20px;
    }

    .modal-header {
        padding: 15px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-body {
        padding: 15px;
    }

    .modal-footer {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }

    .modal-footer button {
        width: 100%;
    }
}

/* ==================== CARDS RESPONSIVE ==================== */

@media (max-width: 768px) {
    .card {
        border-radius: 8px;
    }

    .card-header {
        padding: 15px;
    }

    .card-title {
        font-size: 18px;
    }

    .card-body {
        padding: 15px;
    }

    .card-footer {
        padding: 12px 15px;
    }
}

/* ==================== BUTTONS RESPONSIVE ==================== */

@media (max-width: 576px) {
    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group button {
        width: 100%;
        margin: 5px 0;
    }

    .btn-lg {
        font-size: 16px;
        padding: 12px 24px;
    }
}

/* ==================== IMAGES RESPONSIVE ==================== */

@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }

    .img-responsive {
        width: 100%;
        height: auto;
    }
}

/* ==================== VIDEO RESPONSIVE ==================== */

@media (max-width: 768px) {
    .video-wrapper {
        padding: 0;
    }

    video,
    iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
}

/* ==================== GRID LAYOUTS RESPONSIVE ==================== */

@media (max-width: 992px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

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

/* Larger touch targets for mobile */
@media (max-width: 768px) {

    button,
    a,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Increase font size for better readability */
    body {
        font-size: 16px;
    }

    /* Improve contrast on small screens */
    .text-muted {
        color: #666 !important;
    }
}

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

@media print {

    .no-print,
    header,
    footer,
    .header-auth,
    .scroll-to-top,
    button,
    .nav-item-dropdown {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}

/* ==================== LANDSCAPE ORIENTATION ==================== */

@media (max-width: 768px) and (orientation: landscape) {
    .hero-banner {
        height: 400px;
    }

    .header-logo-wrapper {
        width: 80px;
        height: 80px;
    }

    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}