﻿/* ADMIN PAGE STYLES */

.admin-container {
    padding: 100px 5% 0 5%;
    background: white;
    min-height: 100vh;
}

.header-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #484848;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

    .page-title i {
        color: #2563eb;
    }

.page-subtitle {
    color: #484848;
    font-size: 1.1rem;
    margin: 8px 0 0 0;
}

.btn-primary-modern {
    background: #2563eb;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

    .btn-primary-modern:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
    }

.btn-secondary-modern {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 2px solid #667eea;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

    .btn-secondary-modern:hover {
        background: #667eea;
        color: white;
        transform: translateY(-2px);
    }

.apartments-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.loading-container {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #718096;
}

    .empty-state i {
        font-size: 4rem;
        color: #cbd5e0;
        margin-bottom: 20px;
    }

    .empty-state h3 {
        color: #4a5568;
        margin-bottom: 10px;
    }

.apartments-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #2563eb;
    color: white;
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.apartments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.apartment-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .apartment-card.active {
        border-color: #48bb78;
    }

    .apartment-card.inactive {
        opacity: 0.7;
        border-color: #f56565;
    }

    .apartment-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    }

.card-header {
    position: relative;
}

.apartment-image {
    height: 200px;
    overflow: hidden;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .apartment-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.no-image {
    color: #cbd5e0;
    text-align: center;
}

    .no-image i {
        font-size: 3rem;
        margin-bottom: 10px;
    }

.image-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}

.badges-container {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 8px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

    .status-badge.bg-success {
        background: #48bb78;
    }

    .status-badge.bg-secondary {
        background: #718096;
    }

    .status-badge.bg-warning {
        background: #f6ad55;
    }

    .status-badge.bg-danger {
        background: #f56565;
    }

.card-content {
    padding: 25px;
}

    .card-content .apartment-title {
        font-size: 1.3rem;
        font-weight: 700;
        color: #2d3748 !important;
        margin: 0 0 15px 0;
        line-height: 1.3;
    }

.apartment-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #718096;
    font-size: 0.9rem;
}

    .detail-item i {
        width: 16px;
        color: #2d3748;
    }

    .detail-item.price {
        color: #2d3748;
        font-weight: 600;
        font-size: 1rem;
    }

.apartment-description {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.card-actions {
    display: flex;
    gap: 10px;
    padding: 20px 25px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
    overflow: visible;
}

    .card-actions button {
        flex: 1;
        border: none;
        padding: 10px;
        border-radius: 8px;
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

.btn-edit {
    background: #2563eb;
    color: white;
}

    .btn-edit:hover {
        background: #5a67d8;
        transform: translateY(-1px);
    }

.btn-toggle.activate {
    background: green;
    color: white;
}

.btn-toggle.deactivate {
    background: orange;
    color: white;
}

.btn-toggle:hover {
    transform: translateY(-1px);
}

.btn-delete {
    background: red;
    color: white;
}

    .btn-delete:hover {
        background: #e53e3e;
        transform: translateY(-1px);
    }

/* RESERVATION CALENDAR STYLES */
.reservation-calendar-section {
    margin-top: 20px;
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

.calendar-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
    color: #374151;
    font-size: 16px;
}

.reservation-count {
    color: #6b7280;
    font-weight: normal;
    font-size: 14px;
}

.mini-calendar {
    margin-bottom: 16px;
}

.admin-calendar .custom-date-picker {
    width: 100%;
}

.admin-calendar .date-input {
    display: none;
}

.admin-calendar .calendar-popup {
    position: static;
    box-shadow: none;
    border: 1px solid #e2e8f0;
    width: 100%;
    padding: 12px;
}

.admin-calendar .calendar-backdrop {
    display: none;
}

.admin-calendar .calendar-actions {
    display: none;
}

.admin-calendar .day-cell.reserved-date {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    cursor: pointer;
    border: 2px solid #dc2626;
}

    .admin-calendar .day-cell.reserved-date:hover {
        background: #fee2e2 !important;
    }

.admin-calendar .day-cell.checkout-date {
    background: #fff7ed !important;
    color: #ea580c !important;
}

.all-reservations h5 {
    margin: 0 0 12px 0;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reservations-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fafafa;
}

    .reservations-list::-webkit-scrollbar {
        width: 6px;
    }

    .reservations-list::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 6px;
    }

    .reservations-list::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 6px;
    }

        .reservations-list::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }

.reservation-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

    .reservation-item:last-child {
        border-bottom: none;
    }

    .reservation-item:hover {
        background: #f9fafb;
    }

    .reservation-item.past {
        background: #f8fafc;
        opacity: 0.8;
    }

        .reservation-item.past:hover {
            background: #f1f5f9;
        }

.reservation-dates,
.reservation-client {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-weight: 500;
    font-size: 16px;
}

.reservation-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #9ca3af;
    font-size: 16px;
}

    .reservation-meta .guests,
    .reservation-meta .amount {
        display: flex;
        align-items: center;
        gap: 4px;
    }

.reservation-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.reservation-status {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 12px;
}

    .reservation-status.pending {
        color: #d97706 !important;
        background: #fef3c7;
    }

    .reservation-status.paid {
        color: #059669 !important;
        background: #d1fae5;
    }

    .reservation-status.cancelled {
        color: #dc2626 !important;
        background: #fee2e2;
    }

.past-indicator,
.current-indicator,
.upcoming-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 12px;
}

.past-indicator {
    color: #6b7280;
    background: #f3f4f6;
}

.current-indicator {
    color: #059669;
    background: #d1fae5;
}

.upcoming-indicator {
    color: #2563eb;
    background: #dbeafe;
}

.no-reservations {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* RESERVATION DETAILS MODAL */
.reservation-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.reservation-details {
    padding: 0 24px 24px 24px;
}

.detail-section {
    margin-bottom: 24px;
}

    .detail-section h4 {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0 0 16px 0;
        color: #374151;
        font-size: 16px;
        font-weight: 600;
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 8px;
    }

.detail-grid {
    display: grid;
    gap: 12px;
}

.detail-item .label {
    font-weight: 500;
    color: #6b7280;
}

.detail-item .value {
    font-weight: 600;
    color: #374151;
}

    .detail-item .value.status-pending {
        color: #d97706;
    }

    .detail-item .value.status-paid {
        color: #059669;
    }

    .detail-item .value.status-cancelled {
        color: #dc2626;
    }

/* ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .page-title {
        font-size: 2rem;
    }

    .apartments-grid {
        grid-template-columns: 1fr;
    }

    .card-actions {
        flex-direction: column;
    }
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding: 20px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

    .pagination-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }

    .pagination-btn:active:not(:disabled) {
        transform: translateY(0);
    }

    .pagination-btn:disabled {
        background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
        cursor: not-allowed;
        box-shadow: none;
        opacity: 0.6;
    }

.pagination-info {
    padding: 12px 24px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    color: #4a5568;
}

    .pagination-info strong {
        color: #2563eb;
        font-weight: 700;
    }

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: 12px;
    }

    .pagination-btn {
        width: 100%;
        justify-content: center;
    }
}

.search-section {
    padding: 0 2rem 1.5rem 2rem;
}

.search-bar {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

    .search-bar i.fa-search {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: #64748b;
        font-size: 1rem;
    }

    .search-bar input {
        width: 100%;
        padding: 0.875rem 3rem 0.875rem 2.75rem;
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        font-size: 1rem;
        transition: all 0.2s;
        background: white;
    }

        .search-bar input:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

    .search-bar .clear-search {
        position: absolute;
        right: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        background: #ef4444;
        color: white;
        border: none;
        border-radius: 50%;
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s;
    }

        .search-bar .clear-search:hover {
            background: #dc2626;
            transform: translateY(-50%) scale(1.1);
        }

.stat-card {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

    .stat-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }

    .stat-card.active-filter {
        color: white;
        box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
    }

        .stat-card.active-filter .stat-number,
        .stat-card.active-filter .stat-label {
            color: white;
        }

        .stat-card.active-filter::after {
            content: '✓';
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            background: white;
            color: #3b82f6;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 0.875rem;
        }
.btn-edit.disabled,
.btn-delete.disabled {
    background-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    border: 1px solid #bdbdbd !important;
}

    .btn-edit.disabled i,
    .btn-delete.disabled i {
        color: #666666 !important;
    }

.pagination-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: white;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .pagination-btn:hover:not(.disabled) {
        background: #f9fafb;
        border-color: #d1d5db;
    }

    .pagination-btn.active {
        background: #3b82f6;
        color: white;
        border-color: #3b82f6;
    }

        .pagination-btn.active:hover {
            background: #3b82f6;
            color: white;
            border-color: #3b82f6;
        }

    .pagination-btn.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.pagination-info {
    color: #6b7280;
    font-size: 0.875rem;
}