/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-width: 500px;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: left 0.3s ease;
    z-index: 1000;
}

.sidebar.hidden {
    left: -250px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Ensure icon is visible */
    line-height: 1;
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-toggle-persistent {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background-color: #2c3e50;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle-persistent:hover {
    background-color: #34495e;
}

.sidebar-toggle-persistent.show {
    display: flex;
}

.sidebar-toggle-mobile {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background-color: #2c3e50;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle-mobile:hover {
    background-color: #34495e;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

.toggle-icon {
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

/* Arrow pointing right (→) - points "in" when sidebar is visible */
.toggle-icon.point-in {
    border-width: 8px 0 8px 12px;
    border-color: transparent transparent transparent currentColor;
}

/* Arrow pointing left (←) - points "out" when sidebar is hidden */
.toggle-icon.point-out {
    border-width: 8px 12px 8px 0;
    border-color: transparent currentColor transparent transparent;
}

/* Default: point in (sidebar visible by default) */
.toggle-icon {
    border-width: 8px 0 8px 12px;
    border-color: transparent transparent transparent currentColor;
}

.sidebar-header {
    padding: 20px;
    background-color: #1a252f;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: bold;
}

.sidebar-nav {
    padding: 10px 0;
}

.nav-section {
    margin: 10px 0;
}

.nav-section-header {
    padding: 10px 20px;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #95a5a6;
    font-weight: bold;
}

.nav-item {
    display: block;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: #34495e;
}

.main-content {
    margin-left: 250px;
    flex: 1;
    padding: 20px;
    transition: margin-left 0.3s ease, padding-left 0.3s ease;
}

.sidebar.hidden ~ .main-content {
    margin-left: 0;
    padding-left: 70px; /* Offset for persistent toggle button */
}

/* Ensure sidebar is visible by default on desktop */
@media (min-width: 769px) {
    .sidebar {
        left: 0;
    }
    
    .sidebar.hidden {
        left: -250px;
    }
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #7f8c8d;
    font-size: 1.2rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.contact-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.contact-item select,
.contact-item input {
    flex: 1;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.9rem;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-table thead {
    background-color: #34495e;
    color: white;
}

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

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.flash {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.flash-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.flash-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Dashboard */
.dashboard {
    background: white;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-card h3 {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

.dashboard-section {
    margin-bottom: 30px;
}

.dashboard-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Action Bar */
.action-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.action-bar form {
    display: inline-flex;
    align-items: center;
}

.action-bar .btn {
    display: inline-block;
    box-sizing: border-box;
    line-height: 1.5;
    vertical-align: middle;
}

/* Entity Management */
.entities-page {
    background: white;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.entities-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.entity-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
}

.section-header {
    margin-bottom: 15px;
}

.section-header h2 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.section-header input[type="text"] {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.entity-list {
    max-height: 400px;
    overflow-y: auto;
}

.entity-item {
    padding: 10px;
    margin-bottom: 5px;
    background: white;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entity-item a {
    color: #2c3e50;
    text-decoration: none;
}

.entity-item a:hover {
    text-decoration: underline;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.status-badge.active {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* Booking Card */
.booking-card {
    background: white;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.booking-card.clickable {
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.booking-card.clickable:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.booking-card h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

/* Details */
.details-section {
    background: white;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.details-section h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.detail-item {
    margin-bottom: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
        left: -200px;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar.hidden {
        left: -200px;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding-top: 60px; /* Add space for mobile toggle button */
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    .sidebar-toggle-persistent {
        display: none !important;
    }
    
    .sidebar-toggle-mobile {
        display: flex;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .entities-sections {
        grid-template-columns: 1fr;
    }
}

