/* ========================================
   GLOBAL RESPONSIVE DESIGN SYSTEM
   ======================================== */

/* Base Responsive Variables */
:root {
    --responsive-breakpoint-xs: 480px;
    --responsive-breakpoint-sm: 576px;
    --responsive-breakpoint-md: 768px;
    --responsive-breakpoint-lg: 992px;
    --responsive-breakpoint-xl: 1200px;
    --responsive-breakpoint-xxl: 1400px;
}

/* ========================================
   UNIVERSAL RESPONSIVE STYLES
   ======================================== */

/* Mobile Menu Toggle (Global) */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--primary-color, #3498db);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Extra Large Devices (≥1400px) */
@media (max-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-section {
        padding: 80px 0;
    }
    
    .section-padding {
        padding: 60px 0;
    }
}

/* Large Devices (1200px - 1399px) */
@media (max-width: 1200px) {
    .container {
        max-width: 1140px;
        padding: 0 20px;
    }
    
    .hero-section {
        padding: 70px 0;
    }
    
    .section-padding {
        padding: 50px 0;
    }
    
    .hero-title {
        font-size: 48px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .admin-dashboard .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .profile-container {
        padding: 20px;
    }
    
    .profile-header {
        padding: 30px;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
}

/* Medium Large Devices (992px - 1199px) */
@media (max-width: 992px) {
    .container {
        max-width: 960px;
        padding: 0 15px;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .section-padding {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 42px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-dashboard .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-container {
        padding: 15px;
    }
    
    .profile-header {
        padding: 25px;
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .profile-avatar {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
    
    .profile-title {
        font-size: 24px;
    }
    
    .profile-stats {
        justify-content: center;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .section-title {
        font-size: 20px;
    }
}

/* Medium Devices (768px - 991px) */
@media (max-width: 768px) {
    .container {
        max-width: 720px;
        padding: 0 15px;
    }
    
    .hero-section {
        padding: 50px 0;
    }
    
    .section-padding {
        padding: 30px 0;
    }
    
    .hero-title {
        font-size: 36px;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 16px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-dashboard .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .admin-dashboard .chart-container {
        margin-bottom: 30px;
    }
    
    /* Sidebar Responsive */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .profile-container {
        padding: 10px;
        margin-top: 60px;
    }
    
    .profile-header {
        padding: 20px;
    }
    
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-section {
        padding: 20px 15px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-input {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .profile-info-item {
        padding: 12px 0;
    }
    
    .profile-info-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .profile-info-value {
        font-size: 14px;
    }
    
    /* Tables Responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .orders-table,
    .products-table,
    .customers-table {
        font-size: 14px;
    }
    
    .orders-table th,
    .orders-table td,
    .products-table th,
    .products-table td,
    .customers-table th,
    .customers-table td {
        padding: 10px 8px;
    }
    
    /* Action Buttons Responsive */
    .action-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .btn-action {
        width: 100%;
        justify-content: center;
    }
}

/* Small Devices (576px - 767px) */
@media (max-width: 576px) {
    .container {
        max-width: 540px;
        padding: 0 10px;
    }
    
    .hero-section {
        padding: 40px 0;
    }
    
    .section-padding {
        padding: 25px 0;
    }
    
    .hero-title {
        font-size: 32px;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .mobile-menu-toggle {
        top: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: 16px;
    }
    
    .profile-container {
        padding: 5px;
        margin-top: 50px;
    }
    
    .profile-header {
        padding: 15px;
    }
    
    .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .profile-title {
        font-size: 20px;
    }
    
    .profile-subtitle {
        font-size: 14px;
    }
    
    .profile-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .form-section {
        padding: 15px 10px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-input {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .profile-info-item {
        padding: 10px 0;
    }
    
    .profile-info-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .profile-info-value {
        font-size: 13px;
    }
    
    .profile-info-label {
        font-size: 10px;
    }
    
    /* Tables Extra Responsive */
    .orders-table,
    .products-table,
    .customers-table {
        font-size: 12px;
    }
    
    .orders-table th,
    .orders-table td,
    .products-table th,
    .products-table td,
    .customers-table th,
    .customers-table td {
        padding: 8px 5px;
    }
    
    /* Filter Buttons Responsive */
    .filter-buttons {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .filter-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    /* Search Box Responsive */
    .search-box {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .search-input {
        width: 100%;
        font-size: 14px;
    }
}

/* Extra Small Devices (≤480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }
    
    .hero-section {
        padding: 30px 0;
    }
    
    .section-padding {
        padding: 20px 0;
    }
    
    .hero-title {
        font-size: 28px;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 13px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .profile-container {
        margin-top: 45px;
    }
    
    .profile-header {
        padding: 10px;
    }
    
    .profile-avatar {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .profile-title {
        font-size: 18px;
    }
    
    .profile-subtitle {
        font-size: 12px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .form-section {
        padding: 12px 8px;
    }
    
    .section-title {
        font-size: 15px;
    }
    
    .form-input {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Tables Ultra Responsive */
    .orders-table,
    .products-table,
    .customers-table {
        font-size: 11px;
    }
    
    .orders-table th,
    .orders-table td,
    .products-table th,
    .products-table td,
    .customers-table th,
    .customers-table td {
        padding: 6px 3px;
    }
    
    /* Hide some columns on very small screens */
    .orders-table .hide-mobile,
    .products-table .hide-mobile,
    .customers-table .hide-mobile {
        display: none;
    }
    
    /* Modal Responsive */
    .modal-content {
        margin: 15px;
        max-width: calc(100% - 30px);
    }
    
    .modal-body {
        padding: 15px;
    }
    
    /* Login/Register Forms */
    .auth-form {
        padding: 20px 15px;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .auth-subtitle {
        font-size: 14px;
    }
}

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

.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

.text-center-mobile {
    text-align: center;
}

.flex-column-mobile {
    flex-direction: column;
}

.full-width-mobile {
    width: 100%;
}

/* Mobile-specific utilities */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
    
    .text-center-mobile {
        text-align: center !important;
    }
    
    .flex-column-mobile {
        flex-direction: column !important;
    }
    
    .full-width-mobile {
        width: 100% !important;
    }
}

/* ========================================
   RESPONSIVE TYPOGRAPHY
   ======================================== */

@media (max-width: 768px) {
    h1 { font-size: 28px; }
    h2 { font-size: 24px; }
    h3 { font-size: 20px; }
    h4 { font-size: 18px; }
    h5 { font-size: 16px; }
    h6 { font-size: 14px; }
}

@media (max-width: 576px) {
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    h4 { font-size: 16px; }
    h5 { font-size: 14px; }
    h6 { font-size: 12px; }
}

/* ========================================
   RESPONSIVE IMAGES AND MEDIA
   ======================================== */

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

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

/* ========================================
   RESPONSIVE NAVIGATION
   ======================================== */

.navbar-responsive {
    position: relative;
}

.navbar-toggle {
    display: none;
}

@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
    }
    
    .navbar-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .navbar-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
}

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

@media (max-width: 768px) {
    /* Larger touch targets */
    .btn, .btn-action, .filter-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better focus states */
    .btn:focus,
    .form-input:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}
