/* ============================================================================
   HOSTELO HUB - MASTER STYLESHEET
   A comprehensive stylesheet for all pages with responsive design
   ============================================================================ */

/* ============================================================================
   1. RESET & BASE STYLES
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #F5F7FA;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================================================
   2. TYPOGRAPHY
   ============================================================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: #202124;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* ============================================================================
   3. COLOR VARIABLES
   ============================================================================ */
:root {
    --primary-blue: #2E5C8A;
    --primary-orange: #F7931E;
    --secondary-orange: #FF8C42;
    --success-green: #4CAF50;
    --warning-yellow: #FF9800;
    --error-red: #F44336;
    --text-dark: #202124;
    --text-medium: #5F6368;
    --text-light: #999;
    --border-light: #E8EAED;
    --border-medium: #E0E0E0;
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-lighter: #F0F0F0;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-orange: linear-gradient(135deg, #F7931E, #FF8C42);
    --gradient-green: linear-gradient(135deg, #43e97b, #38f9d7);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-xl: 0 12px 40px rgba(0,0,0,0.15);
}

/* ============================================================================
   4. NAVBAR STYLES
   ============================================================================ */
.navbar {
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
}

.navbar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo .blue { color: var(--primary-blue); }
.logo .orange { color: var(--primary-orange); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links a {
    color: var(--text-medium);
    font-weight: 500;
    font-size: 14px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-orange);
}

.nav-right,
.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-search {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.nav-search input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 2px solid var(--border-light);
    border-radius: 30px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--bg-light);
}

.nav-search input:focus {
    outline: none;
    border-color: var(--primary-orange);
    background: var(--bg-white);
    box-shadow: 0 2px 8px rgba(247,147,30,0.15);
}

.nav-search button,
.nav-search i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.nav-search button {
    background: var(--gradient-orange);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-search button:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 3px 10px rgba(247,147,30,0.3);
}

.icon-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-medium);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: var(--bg-light);
    color: var(--primary-orange);
}

.notification-icon {
    position: relative;
    cursor: pointer;
    font-size: 20px;
    color: var(--primary-blue);
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-orange);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.user-menu:hover {
    background: var(--bg-light);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 12px rgba(102,126,234,0.3);
}

.user-info span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
}

/* ============================================================================
   5. BUTTONS
   ============================================================================ */
.btn,
.cta-btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-danger {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary,
.cta-btn {
    background: var(--gradient-orange);
    color: white;
}

.btn-primary:hover,
.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247,147,30,0.3);
}

.btn-secondary {
    background: var(--bg-lighter);
    color: var(--text-medium);
}

.btn-secondary:hover {
    background: var(--border-medium);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-orange);
    color: var(--primary-orange);
}

.btn-outline:hover {
    background: var(--primary-orange);
    color: white;
}

.btn-danger {
    background: var(--error-red);
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn:disabled,
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-large {
    padding: 16px 40px;
    font-size: 16px;
}

/* ============================================================================
   6. LAYOUT CONTAINERS
   ============================================================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 25px;
}

.dashboard-container,
.browse-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

.detail-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ============================================================================
   7. SIDEBAR
   ============================================================================ */
.sidebar,
.settings-sidebar {
    background: var(--bg-white);
    border-radius: 15px;
    padding: 25px 0;
    box-shadow: var(--shadow-sm);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-menu,
.settings-menu {
    list-style: none;
}

.sidebar-menu li,
.settings-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a,
.settings-menu a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: var(--text-medium);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active,
.settings-menu a:hover,
.settings-menu a.active {
    background: linear-gradient(90deg, rgba(247,147,30,0.1) 0%, transparent 100%);
    color: var(--primary-orange);
    border-left-color: var(--primary-orange);
}

.sidebar-menu a i,
.settings-menu a i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* ============================================================================
   8. CARDS & SECTIONS
   ============================================================================ */
.section-card,
.card,
.hostel-card,
.booking-card {
    background: var(--bg-white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.section-card:hover,
.card:hover {
    box-shadow: var(--shadow-md);
}

.section-title {
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary-orange);
}

.section-subtitle {
    color: var(--text-medium);
    font-size: 14px;
    margin-bottom: 10px;
}

/* ============================================================================
   9. FORMS
   ============================================================================ */
.form-group {
    margin-bottom: 25px;
}

.form-label,
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.form-input,
.form-select,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--bg-white);
}

.form-input:focus,
.form-select:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(247,147,30,0.1);
}

.form-input:disabled,
.form-group input:disabled {
    background: var(--bg-light);
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-help {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 6px;
}

.form-error {
    color: var(--error-red);
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-orange);
}

.checkbox-group label {
    cursor: pointer;
    font-size: 14px;
    color: var(--text-medium);
}

/* ============================================================================
   10. BADGES & TAGS
   ============================================================================ */
.badge,
.tag,
.status-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-block;
}

.badge-featured {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

.badge-verified {
    background: var(--success-green);
    color: white;
}

.badge-type {
    background: var(--primary-blue);
    color: white;
}

.status-completed,
.status-confirmed {
    background: #E8F5E9;
    color: var(--success-green);
}

.status-pending {
    background: #FFF3E0;
    color: var(--warning-yellow);
}

.status-cancelled,
.status-failed {
    background: #FFEBEE;
    color: var(--error-red);
}

/* ============================================================================
   11. MODAL
   ============================================================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 15px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h2 {
    font-size: 24px;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* ============================================================================
   12. TOAST NOTIFICATIONS
   ============================================================================ */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--text-dark);
    color: white;
    padding: 18px 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 2000;
    max-width: 400px;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background: var(--success-green);
}

.toast-error {
    background: var(--error-red);
}

.toast-info {
    background: var(--primary-blue);
}

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

/* ============================================================================
   13. LOADING & EMPTY STATES
   ============================================================================ */
.loading,
.loading-state {
    text-align: center;
    padding: 40px;
}

.spinner,
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-lighter);
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 80px 40px;
}

.empty-state i {
    font-size: 100px;
    color: #DDD;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: var(--text-medium);
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 30px;
}

/* ============================================================================
   14. PAGINATION
   ============================================================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination button,
.pagination a {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 2px solid var(--border-light);
    background: var(--bg-white);
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination button:hover:not(:disabled),
.pagination a:hover {
    border-color: var(--primary-orange);
    color: var(--primary-orange);
}

.pagination button.active,
.pagination a.active {
    background: var(--gradient-orange);
    color: white;
    border-color: var(--primary-orange);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   15. FOOTER
   ============================================================================ */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-col a {
    display: block;
    color: rgba(255,255,255,0.7);
    margin-bottom: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.footer-col a:hover {
    color: var(--primary-orange);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: var(--primary-orange);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}

.footer-bottom a {
    color: rgba(255,255,255,0.7);
}

.footer-bottom a:hover {
    color: var(--primary-orange);
}

/* ============================================================================
   16. UTILITY CLASSES
   ============================================================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ============================================================================
   17. RESPONSIVE DESIGN - TABLETS (max-width: 1024px)
   ============================================================================ */
@media (max-width: 1024px) {
    .dashboard-container,
    .browse-container {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .settings-sidebar {
        position: static;
    }

    .nav-search {
        max-width: 400px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* ============================================================================
   18. RESPONSIVE DESIGN - MOBILE (max-width: 768px)
   ============================================================================ */
@media (max-width: 768px) {
    /* Navbar Mobile */
    .navbar-content {
        padding: 0 15px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 62px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        gap: 0;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links a {
        padding: 15px 0;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-search {
        display: none;
    }

    .nav-right {
        gap: 10px;
    }

    /* Typography */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }

    /* Layout */
    .container,
    .detail-container {
        padding: 0 15px;
    }

    .dashboard-container {
        padding: 20px 15px;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Cards */
    .section-card,
    .card {
        padding: 20px;
    }

    /* Footer */
    .footer {
        padding: 40px 0 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Buttons */
    .btn,
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    /* Pagination */
    .pagination {
        gap: 5px;
    }

    .pagination button,
    .pagination a {
        min-width: 35px;
        height: 35px;
        font-size: 13px;
    }

    /* Toast */
    .toast {
        left: 15px;
        right: 15px;
        bottom: 15px;
        max-width: none;
    }

    /* Modal */
    .modal-content {
        padding: 30px 20px;
        margin: 20px;
    }
}

/* ============================================================================
   19. RESPONSIVE DESIGN - SMALL MOBILE (max-width: 480px)
   ============================================================================ */
@media (max-width: 480px) {
    .logo {
        font-size: 18px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    h1 { font-size: 1.25rem; }
    h2 { font-size: 1.1rem; }
    h3 { font-size: 1rem; }

    .section-card,
    .card {
        padding: 15px;
    }

    .btn,
    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* ============================================================================
   20. PRINT STYLES
   ============================================================================ */
@media print {
    .navbar,
    .sidebar,
    .footer,
    .btn,
    .modal {
        display: none !important;
    }

    body {
        background: white;
    }

    .container,
    .detail-container {
        max-width: 100%;
        padding: 0;
    }
}

/* ============================================================================
   21. ACCESSIBILITY
   ============================================================================ */
/* Focus styles for keyboard navigation */
*:focus {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0;
    }
}