/* Mobile Responsive Styles */

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
        position: relative;
    }
    
    body {
        display: block;
    }
    
    * {
        max-width: 100%;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        width: 260px;
        max-width: 80vw;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100vw;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .content-wrapper {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        width: 100%;
        max-width: 100%;
    }
    
    .stat-card {
        padding: 1rem;
        min-width: 0;
        max-width: 100%;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .dashboard-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
    }
    
    .appointments-list,
    .quick-actions {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    .appointment-item {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .card-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .card-header h3 {
        font-size: 1.125rem;
    }
    
    .card-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    .card {
        box-sizing: border-box;
    }
    
    .card-body {
        box-sizing: border-box;
    }
    
    .appointment-item {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .appointment-time {
        font-size: 0.875rem;
    }
    
    .appointment-details {
        width: 100%;
    }
    
    .appointment-client {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .appointment-service {
        font-size: 0.875rem;
    }
    
    .appointment-status {
        width: 100%;
    }
    
    .appointment-actions {
        width: 100%;
    }
    
    .appointment-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .quick-actions h3 {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }
    
    .action-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        width: 100%;
        max-width: 100%;
    }
    
    .action-btn {
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        text-align: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .action-btn i {
        font-size: 1.5rem;
    }
    
    .action-btn span {
        font-size: 0.813rem;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state i {
        font-size: 2.5rem;
    }
    
    .empty-state p {
        font-size: 0.938rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
    }
    
    .page-actions {
        flex-wrap: wrap;
        overflow-x: visible;
        width: 100%;
    }
    
    .search-box {
        width: 100%;
        max-width: 100%;
    }
    
    .search-box input {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .data-table {
        font-size: 0.813rem;
        width: 100%;
        max-width: 100%;
        display: block;
        overflow-x: auto;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
        white-space: nowrap;
    }
    
    .card {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    .card-body {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }
    
    /* Keep action buttons on one row even on mobile */
    
    .top-header {
        width: 100%;
        max-width: 100%;
        overflow: visible;
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .top-header h1 {
        font-size: 1.25rem;
    }
    
    .company-dropdown-toggle .company-name {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .company-dropdown-menu {
        min-width: 200px;
        max-width: 90vw;
        right: 0;
        left: auto;
        z-index: 10000;
    }
    
    .user-info {
        position: static;
    }
    
    .company-dropdown {
        position: static;
    }
    
    .auth-box {
        padding: 1.5rem;
    }
    
    .modal-content {
        margin: 1rem auto;
        width: calc(100% - 2rem);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem 1.25rem;
    }
    
    .client-select-wrapper {
        flex-direction: column;
    }
    
    .btn-add-client {
        width: 100%;
        justify-content: center;
    }
    
    .modal-split {
        grid-template-columns: 1fr;
    }
    
    .modal-image-side {
        display: none;
    }
    
    .modal-content.modal-lg {
        max-width: 100%;
    }
    
    .modal-content-side {
        padding: 1.5rem;
    }
    
    .benefits-list {
        gap: 1rem;
    }
    
    .benefit-item {
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .benefit-item i {
        font-size: 1.25rem;
        flex-shrink: 0;
    }
    
    .modal-footer-inline {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-footer-inline .btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1rem;
    }
    
    .modal-content.modal-lg {
        max-width: 95vw;
        width: 95vw;
        margin: 1rem auto;
        min-height: auto;
    }
    
    .modal-split {
        flex-direction: column;
        min-height: auto;
    }
    
    .modal-image-side {
        display: none !important;
    }
    
    .modal-content-side {
        max-width: 100%;
        width: 100%;
        padding: 1.5rem;
    }
    
    .modal-body {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .modal-header {
        max-width: 100%;
    }
    
    .modal-header-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .modal-header-inline h3 {
        font-size: 1.5rem;
    }
    
    .modal-footer {
        max-width: 100%;
    }
    
    .modal-close-split {
        position: absolute;
        top: 1rem;
        right: 1rem;
        left: auto !important;
        background: var(--white) !important;
        color: var(--text-primary) !important;
        border: 2px solid var(--border-color) !important;
        z-index: 100;
    }
    
    /* Forms */
    .form-group {
        width: 100%;
        max-width: 100%;
    }
    
    .form-control,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="date"],
    input[type="time"],
    input[type="number"],
    textarea,
    select {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Tables */
    .table-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }
    
    /* Action buttons */
    .action-buttons {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        max-width: 100%;
    }
    
    .btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Select2 dropdown width fix */
    .select2-container {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .select2-selection {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Page-specific fixes */
    .page-title {
        font-size: 1.5rem;
        word-break: break-word;
    }
    
    /* Grid layouts */
    .grid,
    .dashboard-content {
        grid-template-columns: 1fr !important;
        width: 100%;
    }
    
    /* Appointment items */
    .appointment-item {
        width: 100%;
        max-width: 100%;
    }
    
    .appointment-details {
        width: 100%;
        max-width: 100%;
    }
    
    /* Client cards, service cards, etc */
    .client-card,
    .service-card,
    .product-card,
    .promotion-card,
    .giftcard-card,
    .event-card {
        width: 100%;
        max-width: 100%;
    }
    
    /* Settings tabs mobile */
    .settings-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    
    .settings-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    /* Info grids */
    .info-grid,
    .stats-small {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .client-details-grid {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .top-header h1 {
        font-size: 1.25rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        width: 100%;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.813rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
        width: 100%;
    }
    
    .action-btn {
        padding: 1.25rem;
        width: 100%;
    }
    
    .card {
        border-radius: 0.75rem;
        width: 100%;
        max-width: 100%;
    }
}

