/* ==========================================================================
   Base Styles - Parameterized Booking System
   ========================================================================== */

/* CSS Variables for Theming */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --text-color: #333333;
    --background-color: #ffffff;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Navigation & Hamburger Menu
   ========================================================================== */

/* Navbar Base Styles */
.navbar {
    background: var(--primary-color) !important;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color)dd) !important;
    box-shadow: 0 2px 10px var(--shadow-color);
    padding: 0.5rem 0 !important;
    position: relative !important;
    z-index: 1000 !important;
    min-height: 60px !important;
    height: auto !important;
}

.navbar-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 2rem;
}

.navbar-brand {
    color: white !important;
    font-weight: 600;
    font-size: 1.5rem;
    text-decoration: none;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
}

.navbar-brand:hover {
    opacity: 0.8;
}

/* Hamburger Menu Button - Hidden by default, only visible on mobile */
.hamburger-button {
    display: none !important;
    background: var(--primary-color) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    padding: 0.25rem !important;
    cursor: pointer !important;
    width: 35px !important;
    height: 35px !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
    z-index: 9999 !important;
    opacity: 1 !important;
    visibility: hidden !important;
    flex-shrink: 0;
}

.hamburger-button:hover {
    background: var(--primary-color)dd !important;
    border-color: white !important;
}

.hamburger-button:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5) !important;
}

.hamburger-button .hamburger-line {
    display: block !important;
    width: 18px !important;
    height: 2px !important;
    background-color: white !important;
    margin: 3px auto !important;
    transition: all 0.3s ease !important;
    border-radius: 1px !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Override for dark navbar backgrounds */
.navbar {
    background: var(--primary-color) !important;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color)dd) !important;
}

/* If navbar has dark background, make hamburger white */
.navbar[style*="background"] .hamburger-button,
.navbar[style*="#"] .hamburger-button {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
}

.navbar[style*="background"] .hamburger-button .hamburger-line,
.navbar[style*="#"] .hamburger-button .hamburger-line {
    background-color: white;
}

.navbar[style*="background"] .hamburger-button:hover,
.navbar[style*="#"] .hamburger-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

/* Hamburger Animation States */
.hamburger-button.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-button.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-button.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ==========================================================================
   Offcanvas Menu
   ========================================================================== */

/* Offcanvas Close Button */
.offcanvas-close {
    background: var(--primary-color) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    color: white !important;
    font-size: 1.2rem !important;
    cursor: pointer !important;
    padding: 0.5rem !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
    width: 35px !important;
    height: 35px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.offcanvas-close:hover {
    background: var(--primary-color)dd !important;
    border-color: white !important;
    transform: scale(1.05) !important;
}

.offcanvas-close:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5) !important;
}

/* Offcanvas Menu */
.offcanvas {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background-color: white;
    box-shadow: -2px 0 10px var(--shadow-color);
    transition: right 0.3s ease;
    z-index: 1050;
    overflow-y: auto;
}

.offcanvas.show {
    right: 0;
}

.offcanvas-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color)dd);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.offcanvas-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.offcanvas-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.offcanvas-close:hover {
    opacity: 1;
}

.offcanvas-body {
    padding: 1rem;
}

.offcanvas-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.offcanvas-menu li {
    margin-bottom: 0.5rem;
}

.offcanvas-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.offcanvas-menu a:hover {
    background-color: var(--primary-color);
    color: white;
}

.offcanvas-menu a.active {
    background-color: var(--accent-color);
    color: white;
}

/* Overlay */
.offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.offcanvas-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Navigation Menu (Desktop - New Design)
   ========================================================================== */

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 2rem;
    flex: 1;
}

.navbar-nav-main {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
}

.navbar-nav-main .nav-link {
    color: #333333 !important;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.navbar-nav-main .nav-link:hover {
    background-color: var(--primary-color);
    color: white !important;
    transform: translateY(-1px);
}

.navbar-nav-main .nav-link.active {
    background-color: var(--primary-color);
    color: white !important;
}

.navbar-nav-main .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: white;
    transition: width 0.3s ease;
}

.navbar-nav-main .nav-link:hover::after {
    width: 80%;
}

/* Authentication Section */
.navbar-auth {
    display: flex;
    align-items: center;
}

/* Guest Authentication Buttons */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.login-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: #333333 !important;
    border-color: rgba(255, 255, 255, 0.3);
}

.login-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    color: #333333 !important;
}

.register-btn {
    background-color: white;
    color: var(--primary-color) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.register-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Authenticated User Menu */
.user-menu {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 0.5rem;
    gap: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    max-height: 40px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-menu:hover {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.2);
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 120px;
    line-height: 1.1;
}

.username {
    color: #333333;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}

.user-email {
    color: #666666;
    font-size: 0.75rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.profile-btn {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333333 !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.profile-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
    color: #000000 !important;
}

.logout-btn {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545 !important;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.logout-btn:hover {
    background-color: rgba(220, 53, 69, 0.2);
    transform: scale(1.1);
    color: #c82333 !important;
}

.bookings-btn {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--primary-color) !important;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

.bookings-btn:hover {
    background-color: rgba(0, 123, 255, 0.2);
    transform: scale(1.1);
    color: var(--primary-color)dd !important;
}

/* Mobile Authentication Styles */
.offcanvas-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 1rem 0;
}

.offcanvas-user-info {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

.user-avatar {
    font-size: 2rem;
    margin-right: 1rem;
    opacity: 0.8;
}

.user-details {
    flex: 1;
}

.user-details strong {
    display: block;
    font-size: 1rem;
}

.user-details small {
    opacity: 0.8;
    font-size: 0.875rem;
}

.offcanvas-menu .nav-link.btn {
    text-align: center;
    margin: 0.25rem 0;
}

.offcanvas-menu .nav-link.btn-outline-primary {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color) !important;
}

.offcanvas-menu .nav-link.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white !important;
}

.offcanvas-menu .nav-link.btn-primary {
    background-color: var(--primary-color);
    color: white !important;
}

.offcanvas-menu .nav-link.btn-primary:hover {
    background-color: var(--primary-color)dd;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Mobile Menu */
@media (max-width: 768px) {
    .hamburger-button {
        display: flex !important;
        visibility: visible !important;
    }
    
    .navbar-content {
        display: none !important;
    }
    
    .navbar {
        padding: 0.25rem 1rem !important;
        min-height: 50px !important;
    }
    
    .navbar-brand {
        font-size: 1.1rem !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .navbar-wrapper {
        gap: 1rem;
    }
}

/* Desktop Menu */
@media (min-width: 769px) {
    .hamburger-button {
        display: none !important;
        visibility: hidden !important;
    }
    
    .navbar-content {
        display: flex !important;
    }
    
    .offcanvas {
        display: none;
    }
    
    .offcanvas-overlay {
        display: none;
    }
}

/* ==========================================================================
   Common Components
   ========================================================================== */

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 8px var(--shadow-color);
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-color)dd;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-color)dd;
}

.btn-success {
    background-color: var(--accent-color);
    color: white;
}

.btn-success:hover {
    background-color: var(--accent-color)dd;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

/* Forms */
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-color: var(--accent-color);
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 0.5rem;
}

.col-md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    padding: 0 0.5rem;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 0.5rem;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 0.5rem;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.5rem;
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    background-color: transparent;
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 2rem;
    flex-shrink: 0;
}

footer .container {
    text-align: center;
}

footer p {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--text-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* User Dropdown Styles */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 0.375rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 40px;
    min-height: 40px;
    max-height: 40px;
}

.user-dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.user-dropdown-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.user-dropdown-toggle .username {
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.user-dropdown-toggle .fas.fa-chevron-down {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.user-dropdown-toggle[aria-expanded="true"] .fas.fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    width: max-content;
    max-width: 320px;
    z-index: 1050;
    margin: 0.5rem auto 0;
    padding: 0.5rem 0;
    transform: translateX(-40%);
    float: none;
    clear: both;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    color: #333333;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: white !important;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    opacity: 0.8;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.5rem 0;
    border: none;
}

/* Business Navigation Styles */
.business-name-nav {
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(var(--primary-color), 0.1);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    border: 1px solid rgba(var(--primary-color), 0.2);
}

.business-name-nav:hover {
    background: rgba(var(--primary-color), 0.2);
    color: var(--primary-color);
    text-decoration: none;
}
