/* Admin Dashboard Styles */

/* Login Section */
.login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f4c75 0%, #1b262c 50%, #0f4c75 100%);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    padding: 20px;
    position: relative;
}

/* Animated background shapes */
.login-section::before,
.login-section::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.login-section::before {
    width: 600px; height: 600px;
    background: #e67e22;
    top: -200px; right: -150px;
}

.login-section::after {
    width: 400px; height: 400px;
    background: #3282b8;
    bottom: -100px; left: -100px;
    animation-delay: -7s;
    animation-duration: 25s;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -50px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 40px) scale(1.02); }
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-container {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: fadeSlideUp 0.6s ease-out;
    position: relative;
    z-index: 1;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(135deg, #e67e22, #3282b8, #0f4c75);
    border-radius: 18px;
    z-index: -1;
    opacity: 0.4;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    justify-content: center;
    margin-bottom: 20px;
    transform: scale(1.1);
}

.login-header h2 {
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.5;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-group label i {
    color: var(--primary-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e8ecf0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 76, 117, 0.08);
}

.form-error {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 10px;
    display: none;
}

.form-error.show {
    display: block;
}

.login-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.login-divider span {
    background: var(--white);
    padding: 0 15px;
    color: var(--text-light);
    position: relative;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 25px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-link:hover {
    color: #fff;
    transform: translateX(-3px);
}

.login-footer-link {
    text-align: center;
    margin-top: 25px;
}

/* Floating background shapes */
.login-bg-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}
.login-bg-shape.shape-1 {
    width: 320px; height: 320px;
    top: 10%; left: -80px;
    animation: float 18s ease-in-out infinite;
}
.login-bg-shape.shape-2 {
    width: 200px; height: 200px;
    bottom: 15%; right: 5%;
    background: rgba(230, 126, 34, 0.06);
    animation: float 22s ease-in-out infinite reverse;
}
.login-bg-shape.shape-3 {
    width: 150px; height: 150px;
    top: 50%; left: 60%;
    animation: float 15s ease-in-out infinite;
    animation-delay: -5s;
}

.login-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #3282b8);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(15, 76, 117, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 76, 117, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 10px;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 76, 117, 0.2);
}

.btn-danger {
    background: #e74c3c;
    color: var(--white);
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-link {
    background: none;
    color: var(--text-light);
    padding: 8px;
}

.btn-link:hover {
    color: var(--primary-color);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex !important;
}

/* Override styles.css .modal { display:none } so inner modal shows */
.modal-overlay .modal {
    display: block !important;
    position: relative !important;
    z-index: auto !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    background-color: var(--white) !important;
    backdrop-filter: none !important;
}

/* Loading Overlay - Ensure it doesn't block clicks when hidden */
.loading-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* CRITICAL: Prevent blocking clicks when hidden */
    transition: var(--transition);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.modal {
    background: var(--white);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-sm {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--primary-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #eee;
}

.modal form {
    padding: 20px;
}

/* Admin Dashboard Layout */
.admin-body {
    background: var(--bg-light);
}

.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--text-dark);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    color: var(--white);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-item.active {
    border-left: 3px solid var(--primary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.admin-info i {
    font-size: 1.5rem;
}

.sidebar-footer .btn {
    width: 100%;
    margin-bottom: 10px;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
}

.admin-mobile-header {
    display: none;
}

.admin-section {
    animation: fadeIn 0.3s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h1 {
    font-size: 1.75rem;
    color: var(--text-dark);
}

.section-header p {
    color: var(--text-light);
    width: 100%;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
}

.bg-blue { background: #3282b8; }
.bg-green { background: #27ae60; }
.bg-orange { background: #e67e22; }
.bg-purple { background: #8e44ad; }

.stat-info h3 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Recent Section */
.recent-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.recent-section h2 {
    margin-bottom: 20px;
    color: var(--text-dark);
}

.recent-hotels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.recent-hotel-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    transition: var(--transition);
}

.recent-hotel-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.recent-hotel-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.recent-hotel-info h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.recent-hotel-info p {
    font-size: 0.85rem;
    color: var(--text-light);
}

.recent-hotel-info .price {
    color: var(--primary-color);
    font-weight: 600;
}

/* Table */
.table-container {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box-admin {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-light);
    padding: 10px 15px;
    border-radius: 8px;
    flex: 1;
    max-width: 300px;
}

.search-box-admin i {
    color: var(--text-light);
}

.search-box-admin input {
    border: none;
    background: none;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    flex: 1;
}

.filter-box select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    cursor: pointer;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 15px 20px;
    text-align: left;
}

.admin-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.admin-table tr:not(:last-child) td {
    border-bottom: 1px solid #eee;
}

.admin-table tr:hover td {
    background: var(--bg-light);
}

.hotel-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hotel-cell img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.hotel-cell-info h4 {
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.hotel-cell-info p {
    font-size: 0.8rem;
    color: var(--text-light);
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.action-btn.edit {
    background: #e8f4fd;
    color: var(--secondary-color);
}

.action-btn.edit:hover {
    background: var(--secondary-color);
    color: var(--white);
}

.action-btn.delete {
    background: #fde8e8;
    color: #e74c3c;
}

.action-btn.delete:hover {
    background: #e74c3c;
    color: var(--white);
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.no-data i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Hotel Form */
.hotel-form {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.hotel-form .form-group {
    margin-bottom: 20px;
}

.image-preview {
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 300px;
}

.image-preview img {
    width: 100%;
    display: block;
}

/* Image Upload Tabs */
.image-upload-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.img-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.img-tab.active {
    background: var(--primary-color);
    color: white;
}

.img-tab:hover:not(.active) {
    background: #e8e8e8;
}

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: #fafafa;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(15, 76, 117, 0.04);
}

.drop-zone-text i {
    font-size: 2rem;
    color: #bbb;
    margin-bottom: 10px;
    display: block;
}

.file-drop-zone:hover .drop-zone-text i,
.file-drop-zone.drag-over .drop-zone-text i {
    color: var(--primary-color);
}

.drop-zone-text p {
    margin: 0 0 5px;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.drop-zone-text small {
    color: var(--text-light);
    font-size: 0.8rem;
}

.browse-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* Upload Progress */
.upload-progress {
    margin-top: 12px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

#uploadStatus {
    font-size: 0.8rem;
    color: var(--text-light);
}

.amenities-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: var(--transition);
}

.checkbox-label:hover {
    border-color: var(--primary-color);
}

.checkbox-label input:checked + i {
    color: var(--primary-color);
}

.checkbox-label input {
    width: 18px;
    height: 18px;
}

.checkbox-label i {
    color: var(--text-light);
}

.status-toggle {
    border: none !important;
    padding: 0 !important;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #2ecc71;
    color: var(--white);
    padding: 15px 25px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 4000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    background: #e74c3c;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: var(--transition);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Text utilities */
.text-muted {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .amenities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        background: var(--white);
        box-shadow: var(--shadow);
        margin: -30px -30px 30px;
    }

    .menu-toggle {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--text-dark);
    }

    .admin-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .admin-main {
        padding: 20px;
    }

    .admin-mobile-header {
        margin: -20px -20px 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .amenities-grid {
        grid-template-columns: 1fr 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box-admin {
        max-width: none;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
    }

    .login-section::before {
        width: 300px; height: 300px;
    }
    .login-section::after {
        width: 200px; height: 200px;
    }

    .amenities-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        margin: 10px;
    }
}

/* Login section password toggle */
.login-form .form-group {
    position: relative;
}

/* Login features strip */
.login-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.login-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-light);
}

.login-feature i {
    font-size: 1rem;
    color: var(--primary-color);
    opacity: 0.7;
}

/* Login powered-by */
.login-powered {
    text-align: center;
    margin-top: 14px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.5px;
}
