/* =====================================
Enhanced Responsive Design for AHKSquare
Author: AI Assistant
Description: Comprehensive responsive design enhancements
Version: 1.0
========================================*/

/* =====================================
GLOBAL RESPONSIVE ENHANCEMENTS
========================================*/

/* Extra Large Devices (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title h2 {
        font-size: 3rem;
    }
}

/* Large Devices (1200px and up) */
@media (min-width: 1200px) {
    .hero-title {
        font-size: 3.5rem;
    }
    
    .section-title h2 {
        font-size: 2.5rem;
    }
    
    .modern-container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Medium Devices (992px and up) */
@media (min-width: 992px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .section-title h2 {
        font-size: 2.2rem;
    }
    
    .grid-responsive {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 30px;
    }
}

/* Small Devices (768px and up) */
@media (min-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    .grid-responsive {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 25px;
    }
}

/* Extra Small Devices (576px and up) */
@media (min-width: 576px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
}

/* =====================================
MOBILE-FIRST RESPONSIVE DESIGN
========================================*/

/* Extra Small Devices (less than 576px) */
@media (max-width: 575.98px) {
    /* Typography */
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title h2 {
        font-size: 1.6rem;
    }
    
    .section-title p {
        font-size: 0.9rem;
    }
    
    /* Spacing */
    .section {
        padding: 40px 0;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    /* Forms */
    .form-control {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    /* Cards */
    .card {
        margin-bottom: 20px;
    }
    
    .card-body {
        padding: 20px 15px;
    }
    
    /* Navigation */
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        padding: 10px 0;
    }
    
    /* Grid Systems */
    .grid-responsive {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Product Cards */
    .product-card {
        margin-bottom: 20px;
    }
    
    .product-image {
        height: 200px;
    }
    
    /* Hero Sections */
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-content {
        padding: 20px 15px;
    }
}

/* Small Devices (576px to 767.98px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
    
    .grid-responsive {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .container {
        padding: 0 20px;
    }
}

/* Medium Devices (768px to 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    .grid-responsive {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
    }
    
    .container {
        padding: 0 30px;
    }
}

/* Large Devices (992px to 1199.98px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .section-title h2 {
        font-size: 2.2rem;
    }
    
    .grid-responsive {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 30px;
    }
}

/* =====================================
SPECIFIC COMPONENT RESPONSIVENESS
========================================*/

/* Navigation Responsiveness */
@media (max-width: 991.98px) {
    .navbar-toggler {
        border: none;
        padding: 4px 8px;
    }
    
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.95);
        margin-top: 10px;
        border-radius: 10px;
        padding: 20px;
    }
    
    .navbar-nav .nav-link {
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
}

/* Hero Section Responsiveness */
@media (max-width: 767.98px) {
    .hero-slide {
        height: 400px !important;
    }
    
    .hero-content {
        text-align: center;
        padding: 30px 20px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
}

/* Product Grid Responsiveness */
@media (max-width: 575.98px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .product-card {
        margin-bottom: 15px;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-info {
        padding: 15px;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

@media (min-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}

/* Form Responsiveness */
@media (max-width: 575.98px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-control {
        width: 100%;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 10px;
    }
}

/* Card Responsiveness */
@media (max-width: 575.98px) {
    .card-columns {
        column-count: 1;
    }
    
    .card-deck {
        flex-direction: column;
    }
    
    .card-deck .card {
        margin-bottom: 20px;
    }
}

/* Table Responsiveness */
@media (max-width: 767.98px) {
    .table-responsive {
        border: none;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 8px 4px;
    }
}

/* Modal Responsiveness */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-content {
        border-radius: 10px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 20px 15px;
    }
    
    .modal-footer {
        padding: 15px;
    }
}

/* =====================================
UTILITY CLASSES FOR RESPONSIVENESS
========================================*/

/* Display Utilities */
.d-xs-none { display: none !important; }
.d-xs-block { display: block !important; }
.d-xs-inline { display: inline !important; }
.d-xs-inline-block { display: inline-block !important; }
.d-xs-flex { display: flex !important; }
.d-xs-inline-flex { display: inline-flex !important; }

@media (min-width: 576px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-inline { display: inline !important; }
    .d-sm-inline-block { display: inline-block !important; }
    .d-sm-flex { display: flex !important; }
    .d-sm-inline-flex { display: inline-flex !important; }
}

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-inline { display: inline !important; }
    .d-md-inline-block { display: inline-block !important; }
    .d-md-flex { display: flex !important; }
    .d-md-inline-flex { display: inline-flex !important; }
}

@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-inline { display: inline !important; }
    .d-lg-inline-block { display: inline-block !important; }
    .d-lg-flex { display: flex !important; }
    .d-lg-inline-flex { display: inline-flex !important; }
}

@media (min-width: 1200px) {
    .d-xl-none { display: none !important; }
    .d-xl-block { display: block !important; }
    .d-xl-inline { display: inline !important; }
    .d-xl-inline-block { display: inline-block !important; }
    .d-xl-flex { display: flex !important; }
    .d-xl-inline-flex { display: inline-flex !important; }
}

/* Text Alignment Utilities */
.text-xs-left { text-align: left !important; }
.text-xs-center { text-align: center !important; }
.text-xs-right { text-align: right !important; }

@media (min-width: 576px) {
    .text-sm-left { text-align: left !important; }
    .text-sm-center { text-align: center !important; }
    .text-sm-right { text-align: right !important; }
}

@media (min-width: 768px) {
    .text-md-left { text-align: left !important; }
    .text-md-center { text-align: center !important; }
    .text-md-right { text-align: right !important; }
}

@media (min-width: 992px) {
    .text-lg-left { text-align: left !important; }
    .text-lg-center { text-align: center !important; }
    .text-lg-right { text-align: right !important; }
}

@media (min-width: 1200px) {
    .text-xl-left { text-align: left !important; }
    .text-xl-center { text-align: center !important; }
    .text-xl-right { text-align: right !important; }
}

/* Spacing Utilities */
.p-xs-0 { padding: 0 !important; }
.p-xs-1 { padding: 0.25rem !important; }
.p-xs-2 { padding: 0.5rem !important; }
.p-xs-3 { padding: 1rem !important; }
.p-xs-4 { padding: 1.5rem !important; }
.p-xs-5 { padding: 3rem !important; }

.m-xs-0 { margin: 0 !important; }
.m-xs-1 { margin: 0.25rem !important; }
.m-xs-2 { margin: 0.5rem !important; }
.m-xs-3 { margin: 1rem !important; }
.m-xs-4 { margin: 1.5rem !important; }
.m-xs-5 { margin: 3rem !important; }

/* =====================================
LANDSCAPE ORIENTATION SUPPORT
========================================*/

@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-slide {
        height: 300px !important;
    }
    
    .section {
        padding: 30px 0;
    }
    
    .navbar {
        padding: 5px 0;
    }
}

/* =====================================
HIGH DPI DISPLAY SUPPORT
========================================*/

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-slide {
        background-size: cover;
    }
    
    .product-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* =====================================
PRINT STYLES
========================================*/

@media print {
    .navbar,
    .footer,
    .btn,
    .hero-section {
        display: none !important;
    }
    
    .container {
        width: 100% !important;
        max-width: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .text-white {
        color: #000 !important;
    }
    
    .bg-gradient {
        background: #fff !important;
    }
}

/* =====================================
ACCESSIBILITY ENHANCEMENTS
========================================*/

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 2px solid #000;
    }
    
    .form-control {
        border: 2px solid #000;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        color: #fff;
    }
    
    .form-control {
        background-color: #4a5568;
        color: #fff;
        border-color: #718096;
    }
    
    .btn-outline-primary {
        border-color: #4299e1;
        color: #4299e1;
    }
}
