/* assets/css/responsive-framework.css */
/* Mobile First Approach - Base Styles */

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #f8f9fa;
    --dark-text: #2c3e50;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-text);
    overflow-x: hidden;
}

/* Responsive Typography */
html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; margin-bottom: 0.875rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.625rem; }
h5 { font-size: 1.125rem; margin-bottom: 0.5rem; }
h6 { font-size: 1rem; margin-bottom: 0.5rem; }

@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
}

/* Fluid Container */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container { max-width: 540px; }
}
@media (min-width: 768px) {
    .container { max-width: 720px; }
}
@media (min-width: 992px) {
    .container { max-width: 960px; }
}
@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}

/* Responsive Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

[class*="col-"] {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

/* Mobile First Grid */
.col {
    flex-basis: 0;
    flex-grow: 1;
    max-width: 100%;
}

.col-auto {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
}

/* Responsive Columns */
@media (max-width: 576px) {
    .col-xs-12 { flex: 0 0 100%; max-width: 100%; }
    .col-xs-6 { flex: 0 0 50%; max-width: 50%; }
    .col-xs-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-xs-3 { flex: 0 0 25%; max-width: 25%; }
}

@media (min-width: 576px) {
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
}

@media (min-width: 768px) {
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    .col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
}

@media (min-width: 992px) {
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
    .col-lg-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
}

/* Responsive Business Page Styling */
.business-header {
    padding: 40px 0;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .business-header {
        padding: 30px 0;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .business-header {
        padding: 20px 0;
    }
}

/* Responsive Logo */
.business-logo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .business-logo {
        width: 120px;
        height: 120px;
        margin-bottom: 15px;
    }
}

@media (max-width: 576px) {
    .business-logo {
        width: 100px;
        height: 100px;
        margin-bottom: 10px;
    }
}

/* Responsive Navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-toggler {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
}

.navbar-collapse {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 768px) {
    .navbar-toggler {
        display: block;
    }
    
    .navbar-collapse {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: white;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 999;
    }
    
    .navbar-collapse.active {
        display: flex;
    }
    
    .navbar-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-item {
        width: 100%;
        text-align: center;
    }
    
    .nav-link {
        padding: 12px 15px;
        display: block;
    }
}

/* Responsive Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: var(--transition);
    margin-bottom: 20px;
    overflow: hidden;
}

.service-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-card .card-body {
    flex: 1;
}

@media (max-width: 768px) {
    .card {
        margin-bottom: 15px;
    }
}

/* Responsive Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .gallery-item img {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .gallery-item img {
        height: 150px;
    }
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 10px;
    transform: translateY(100%);
    transition: var(--transition);
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* Responsive Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

@media (max-width: 768px) {
    .form-control {
        padding: 8px 10px;
        font-size: 16px; /* Prevents zoom on mobile */
    }
}

/* Responsive Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-block {
    display: block;
    width: 100%;
}

@media (max-width: 768px) {
    .btn {
        padding: 8px 16px;
        font-size: 0.875rem;
    }
}

/* Responsive Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

@media (max-width: 768px) {
    th, td {
        padding: 8px;
        font-size: 0.875rem;
    }
}

/* Business Hours Responsive */
.business-hours {
    background: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 20px;
}

.hour-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

@media (max-width: 576px) {
    .hour-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .hour-item strong {
        margin-bottom: 5px;
    }
}

/* Reviews Section Responsive */
.review-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

@media (max-width: 576px) {
    .review-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .review-header .rating-stars {
        margin-top: 5px;
    }
}

/* Rating Stars Responsive */
.rating-stars {
    display: inline-flex;
    gap: 2px;
}

.rating-stars i {
    font-size: 1rem;
}

@media (max-width: 576px) {
    .rating-stars i {
        font-size: 0.875rem;
    }
}

/* Modal Responsive */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal.active {
    display: flex;
}

.modal-dialog {
    width: 90%;
    max-width: 500px;
    margin: 20px;
}

@media (max-width: 576px) {
    .modal-dialog {
        width: 95%;
        margin: 10px;
    }
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header,
.modal-footer {
    padding: 15px;
}

.modal-body {
    padding: 20px;
    max-height: calc(90vh - 130px);
    overflow-y: auto;
}

@media (max-width: 768px) {
    .modal-header,
    .modal-footer {
        padding: 12px;
    }
    
    .modal-body {
        padding: 15px;
    }
}

/* Sidebar Responsive */
.sidebar {
    background: var(--secondary-color);
    min-height: 100vh;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 80%;
        max-width: 300px;
        z-index: 1050;
        overflow-y: auto;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* Footer Responsive */
footer {
    background: var(--secondary-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 40px;
}

@media (max-width: 768px) {
    footer {
        padding: 30px 0 15px;
        margin-top: 30px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

@media (max-width: 768px) {
    .text-sm-center { text-align: center; }
    .text-sm-left { text-align: left; }
    .text-sm-right { text-align: right; }
}

.hide-mobile {
    display: block;
}

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

.show-mobile {
    display: none;
}

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

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 2rem; }

/* Touch-friendly elements for mobile */
@media (max-width: 768px) {
    button, 
    .btn,
    .nav-link,
    .clickable {
        min-height: 44px;
        min-width: 44px;
    }
    
    input,
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on focus in iOS */
    }
}

/* Loading spinner responsive */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@media (max-width: 576px) {
    .spinner {
        width: 30px;
        height: 30px;
        border-width: 2px;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notifications responsive */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 12px 20px;
    min-width: 200px;
    max-width: 90%;
    z-index: 1100;
    animation: slideIn 0.3s ease;
}

@media (max-width: 576px) {
    .toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Image optimization for mobile */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive video embeds */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    footer {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        width: 100%;
        max-width: none;
    }
}