/* BookingPlace - Mobile & Responsive Styles */

/* Mobile-first approach */
@media (max-width: 575.98px) {
    /* Extra small devices (phones, less than 576px) */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .hero-section {
        padding: 40px 0;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .service-card {
        margin-bottom: 20px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
        font-size: 1rem;
        padding: 15px;
    }
    
    .btn-group .btn {
        width: auto;
    }
    
    .card {
        margin-bottom: 20px;
    }
    
    .navbar-nav {
        text-align: center;
        margin-top: 15px;
    }
    
    .nav-link {
        padding: 15px 0 !important;
        font-size: 1.1rem;
    }
    
    .dropdown-menu {
        border: none;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    }
    
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 15px;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    /* Small devices (landscape phones, 576px and up) */
    .hero-section {
        padding: 50px 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .service-card {
        margin-bottom: 25px;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    /* Medium devices (tablets, 768px and up) */
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2.25rem;
    }
    
    .service-card {
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    /* General mobile styles */
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .service-card {
        margin-bottom: 20px;
    }
    
    .navbar-nav {
        text-align: center;
        margin-top: 15px;
    }
    
    .nav-link {
        padding: 10px 0 !important;
    }
    
    .card {
        margin-bottom: 20px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn-group .btn {
        width: auto;
    }
    
    .table-responsive {
        border: none;
    }
    
    .modal-lg {
        max-width: 95%;
    }
    
    .pagination {
        justify-content: center;
    }
    
    .pagination .page-link {
        padding: 12px 16px;
    }
    
    /* Hide less important columns on mobile */
    .table th:nth-child(n+4),
    .table td:nth-child(n+4) {
        display: none;
    }
    
    .table th:nth-child(1),
    .table td:nth-child(1),
    .table th:nth-child(2),
    .table td:nth-child(2),
    .table th:last-child,
    .table td:last-child {
        display: table-cell;
    }
}

/* Mobile navigation enhancements */
@media (max-width: 991.98px) {
    .navbar-toggler {
        border: none;
        padding: 8px 12px;
        font-size: 1.2rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
    
    .navbar-collapse {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid rgba(0,0,0,0.1);
    }
    
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none;
        box-shadow: none;
        background: transparent;
        margin-top: 0;
    }
    
    .dropdown-item {
        padding: 12px 20px;
        color: var(--dark-color);
        border-radius: 8px;
        margin: 2px 0;
    }
    
    .dropdown-item:hover {
        background: var(--primary-color);
        color: white;
    }
}

/* Touch improvements */
@media (max-width: 991.98px) {
    /* Larger touch targets */
    .btn {
        min-height: 48px;
        padding: 12px 24px;
    }
    
    .nav-link {
        min-height: 48px;
        padding: 12px 16px !important;
    }
    
    .form-control,
    .form-select {
        min-height: 48px;
        padding: 12px 16px;
    }
    
    .dropdown-item {
        min-height: 48px;
        padding: 12px 20px;
    }
    
    /* Improve tap highlighting */
    .btn,
    .nav-link,
    .dropdown-item,
    .card-link {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
    }
}

/* Mobile bottom navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding: 8px 0;
    z-index: 1000;
    display: none;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
}

.mobile-bottom-nav .nav {
    justify-content: space-around;
}

.mobile-bottom-nav .nav-link {
    flex-direction: column;
    padding: 8px 12px !important;
    color: var(--dark-color);
    font-size: 0.75rem;
    min-height: auto;
    text-align: center;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.mobile-bottom-nav .nav-link.active,
.mobile-bottom-nav .nav-link:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.mobile-bottom-nav .nav-link i {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

@media (max-width: 767.98px) {
    .mobile-bottom-nav {
        display: block;
    }
    
    .main-content {
        padding-bottom: 80px;
    }
}

/* Quick action buttons for mobile */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.quick-action-btn {
    background: white;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    color: var(--dark-color);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.quick-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    color: var(--primary-color);
    text-decoration: none;
}

.quick-action-btn i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
    color: var(--primary-color);
}

.quick-action-btn .title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.quick-action-btn .subtitle {
    font-size: 0.75rem;
    color: #666;
}

@media (max-width: 575.98px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .quick-action-btn {
        padding: 15px 10px;
    }
    
    .quick-action-btn i {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    .quick-action-btn .title {
        font-size: 0.8rem;
    }
    
    .quick-action-btn .subtitle {
        font-size: 0.7rem;
    }
}

/* Mobile search enhancements */
.mobile-search {
    position: relative;
    margin: 20px 0;
}

.mobile-search .search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 25px;
    font-size: 16px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.mobile-search .search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
    outline: none;
}

.mobile-search .voice-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-search .voice-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-50%) scale(1.1);
}

.mobile-search .voice-btn.listening {
    background: var(--danger-color);
    animation: pulse 1s infinite;
}

/* Pull to refresh indicator */
.pull-refresh-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 15px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 9999;
}

.pull-refresh-indicator.show {
    transform: translateY(0);
}

.pull-refresh-indicator i {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

/* Status indicators for mobile */
.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 1001;
    transition: all 0.3s ease;
}

.connection-status.online {
    background: var(--success-color);
    color: white;
}

.connection-status.offline {
    background: var(--danger-color);
    color: white;
}

/* Install prompt styles */
.install-prompt {
    position: fixed;
    bottom: 80px;
    left: 20px;
    right: 20px;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 1002;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border: 2px solid var(--primary-color);
}

.install-prompt.show {
    transform: translateY(0);
}

.install-prompt .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
}

.install-prompt h6 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.install-prompt p {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9rem;
}

.install-prompt .btn {
    width: 100%;
    margin-bottom: 10px;
}

/* Landscape orientation fixes */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .mobile-bottom-nav {
        display: none;
    }
    
    body {
        padding-bottom: 0;
    }
    
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .install-prompt {
        bottom: 20px;
    }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) {
    .mobile-bottom-nav {
        background: #1a1a1a;
        border-top: 1px solid #333;
    }
    
    .mobile-bottom-nav .nav-link {
        color: #ccc;
    }
    
    .mobile-bottom-nav .nav-link.active,
    .mobile-bottom-nav .nav-link:hover {
        color: var(--primary-color);
        background: rgba(102, 126, 234, 0.2);
    }
    
    .quick-action-btn {
        background: #1a1a1a;
        border-color: #333;
        color: #ccc;
    }
    
    .mobile-search .search-input {
        background: #1a1a1a;
        border-color: #333;
        color: #ccc;
    }
    
    .install-prompt {
        background: #1a1a1a;
        color: #ccc;
    }
}
