/* ========================================
   IOpenRoom Custom Styles
   ======================================== */

/* Global Styles */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

/* Header Styles */
#main-header {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
    overflow: visible !important;
}

.top-bar {
    font-size: 0.9rem;
    position: relative;
    z-index: 1040;
    overflow: visible !important;
}

.top-bar .container {
    overflow: visible !important;
}

.top-bar .row {
    overflow: visible !important;
}

.navbar-brand img {
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

/* Dropdown Menu Z-Index Fix */
.top-bar .dropdown-menu {
    z-index: 1060 !important;
    max-width: 350px;
    max-height: 90vh;
    overflow-y: auto;
    position: absolute !important;
}

.top-bar .dropdown {
    position: relative;
    z-index: 1050;
}

.top-bar .user-menu .dropdown {
    position: relative;
    z-index: 1050;
}

.top-bar .user-menu .dropdown-menu {
    z-index: 1060 !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
}

/* Ensure main navbar is below top-bar dropdowns */
.navbar {
    position: relative;
    z-index: 1030;
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
}

.search-box {
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.search-box input,
.search-box select {
    border: 2px solid #e9ecef;
    padding: 0.75rem;
}

.search-box input:focus,
.search-box select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Cards */
.hotel-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    border: none;
}

.hotel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

.hotel-card .card-img-top {
    transition: transform 0.3s ease;
}

.hotel-card:hover .card-img-top {
    transform: scale(1.05);
}

.hover-shadow {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.hover-shadow-lg:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
}

/* District Cards */
.district-card .card {
    transition: all 0.3s ease;
    border-radius: 10px;
    cursor: pointer;
}

.district-card:hover .card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    transform: translateY(-3px);
}

.district-card:hover .card * {
    color: white !important;
}

/* Share & Favorite Buttons */
.share-btn,
.favorite-btn {
    transition: all 0.3s ease;
    cursor: pointer;
}

.share-btn:hover {
    background: rgba(0, 0, 0, 0.8) !important;
    transform: scale(1.1);
}

.favorite-btn:hover {
    background: rgba(220, 53, 69, 0.9) !important;
    transform: scale(1.1);
}

.favorite-btn.active {
    background: var(--danger-color) !important;
}

.favorite-btn.active i {
    color: white !important;
}

.favorite-btn.active:hover {
    background: #c82333 !important;
}

/* Featured Badge */
.hotel-card .bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    box-shadow: 2px 2px 8px rgba(220, 53, 69, 0.3);
}

/* Rating Stars */
.stars {
    display: inline-block;
}

.stars i {
    margin-right: 0;
}



/* Hotel Detail Page */
.hotel-detail-page .hotel-gallery {
    border-radius: 15px;
    overflow: hidden;
}

.hotel-detail-page .card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.booking-card {
    position: sticky;
    top: 80px;
}

/* Swiper Customization */
.swiper {
    width: 100%;
    height: 500px;
    border-radius: 15px;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swiper-button-next,
.swiper-button-prev {
    color: white;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 20px;
}

.swiper-pagination-bullet-active {
    background: white;
}

/* Rating Input */
.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.rating-input input {
    display: none;
}

.rating-input label {
    cursor: pointer;
    font-size: 1.5rem;
    color: #ddd;
    transition: color 0.2s ease;
    margin-right: 5px;
}

.rating-input input:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label {
    color: #ffc107;
}

/* Footer */
#main-footer {
    margin-top: auto;
}

#main-footer a:hover {
    color: white !important;
}

.social-links a {
    transition: transform 0.3s ease;
    display: inline-block;
}

.social-links a:hover {
    transform: translateY(-3px);
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    display: none;
    padding: 0;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

#back-to-top.show {
    display: block;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Stats Section */
.stats-section .stat-item {
    transition: transform 0.3s ease;
}

.stats-section .stat-item:hover {
    transform: translateY(-5px);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .swiper {
        height: 300px;
    }

    .booking-card {
        position: static;
    }

    .hero-section {
        padding: 50px 0 !important;
    }

    .display-4 {
        font-size: 2rem;
    }

    .lead {
        font-size: 1rem;
    }

    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    /* Ensure user menu is visible on mobile */
    .top-bar .user-menu {
        margin-top: 0.5rem;
    }

    .top-bar .col-md-6 {
        margin-bottom: 0.5rem;
    }

    .top-bar .col-md-6:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 576px) {
    .top-bar .contact-info {
        font-size: 0.8rem;
    }

    .navbar-brand span {
        font-size: 1.2rem;
    }

    /* Stack buttons vertically on very small screens */
    .top-bar .language-switcher,
    .top-bar .user-menu {
        display: block !important;
        margin: 0.25rem 0;
    }

    .top-bar .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Location Filter Pills */
.location-filter-section {
    border-bottom: 1px solid #e9ecef;
}

.location-pills {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f8f9fa;
}

.location-pill {
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #495057;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.location-pill:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.location-pill.active {
    background: #000000;
    color: white;
    border-color: #000000;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.location-pill.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* Responsive adjustments for location pills */
@media (max-width: 768px) {
    .location-pill {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Print Styles */
@media print {
    header, footer, .btn, .favorite-btn {
        display: none;
    }
}

/* ========================================
   Review & Avatar Styles
   ======================================== */

/* Review Card */
.review-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.review-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* Review Avatar */
.review-avatar img {
    object-fit: cover;
    border: 3px solid #f8f9fa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Review User Info */
.review-user-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
}

.review-user-role {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Review Rating Stars */
.review-rating {
    display: flex;
    gap: 2px;
    margin-top: 0.5rem;
}

.review-rating i {
    font-size: 1.1rem;
}

.review-rating .fa-star.text-warning {
    color: #ffc107 !important;
}

/* Review Title */
.review-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

/* Review Comment */
.review-comment {
    font-size: 1rem;
    color: #495057;
    line-height: 1.7;
    margin-bottom: 0;
}

/* Review Actions */
.review-actions {
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* Review Form */
.review-form-container {
    margin-bottom: 2rem;
    border-radius: 12px;
}

.review-form-container .card-title {
    color: #212529;
    font-weight: 600;
}

/* Star Rating Input */
.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-start;
    gap: 8px;
    margin: 0.5rem 0;
}

.star-rating-input input[type="radio"] {
    display: none;
}

.star-rating-input label {
    cursor: pointer;
    font-size: 2rem;
    color: #dee2e6;
    transition: all 0.2s ease;
    margin: 0;
}

.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input label.active {
    color: #ffc107;
    transform: scale(1.1);
}

.star-rating-input input:checked ~ label {
    color: #ffc107;
}

/* Half Star Rating Input */
.star-rating-input-half {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    margin: 0.5rem 0;
}

.star-rating-input-half input[type="radio"] {
    display: none;
}

.star-rating-input-half label {
    cursor: pointer;
    font-size: 2.5rem;
    color: #dee2e6;
    transition: all 0.2s ease;
    margin: 0;
    padding: 0 2px;
    position: relative;
}

.star-rating-input-half label:hover {
    transform: scale(1.15);
}

.star-rating-input-half label.active {
    color: #ffc107;
}

.star-rating-input-half label.star-half {
    margin-left: -1.25rem;
    z-index: 1;
}

.star-rating-input-half label.star-full {
    z-index: 0;
}

/* Ensure half star appears on top when needed */
.star-rating-input-half input:checked + label.star-half {
    z-index: 2;
}

/* Avatar Upload Section */
.avatar-upload-section {
    text-align: center;
}

.avatar-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f8f9fa;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin: 0 auto 1rem;
    display: block;
}

.avatar-upload-btn {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.avatar-upload-btn input[type="file"] {
    position: absolute;
    left: -9999px;
}

/* User Avatar in Comments */
.user-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-md {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

/* Review Date */
.review-date {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Character Counter */
#charCount {
    font-weight: 600;
    color: #28a745;
}

#charCount.text-danger {
    color: #dc3545 !important;
}

/* Responsive Styles for Reviews */
@media (max-width: 768px) {
    .review-avatar img {
        width: 60px;
        height: 60px;
    }
    
    .review-user-name {
        font-size: 1.1rem;
    }
    
    .review-title {
        font-size: 1.25rem;
    }
    
    .star-rating-input label {
        font-size: 1.5rem;
    }
    
    .review-card {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .review-card .d-flex {
        flex-direction: column;
    }
    
    .review-avatar {
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .review-avatar img {
        margin: 0 auto;
    }
}

/* Review Modal */
.modal-content {
    border-radius: 12px;
    border: none;
}

.modal-header {
    border-bottom: 2px solid #f8f9fa;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-footer {
    border-top: 2px solid #f8f9fa;
}

/* Profile Page Avatar */
.profile-avatar-container {
    position: relative;
    display: inline-block;
}

.profile-avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-avatar-container:hover .profile-avatar-overlay {
    opacity: 1;
}

.profile-avatar-overlay i {
    color: white;
    font-size: 2rem;
}
