/* ===================================
   PROFILE.CSS - Stylesheet cho trang hồ sơ cá nhân
   Hệ thống cho thuê nhà/phòng trọ
   =================================== */

/* ===================================
   1. PROFILE CARD - Thẻ hồ sơ sidebar
   =================================== */
.profile-card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.profile-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===================================
   2. AVATAR UPLOAD - Tải lên ảnh đại diện
   =================================== */
.avatar-upload-label {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid white;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.avatar-upload-label:hover {
    background: #0b5ed7;
    transform: scale(1.1);
}

.avatar-upload-label i {
    pointer-events: none;
}

/* ===================================
   3. STAT BOX - Hộp thống kê
   =================================== */
.stat-box {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.stat-box:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.stat-box h6 {
    font-weight: 700;
    color: var(--primary-color);
}

/* ===================================
   4. SIDEBAR MENU - Menu sidebar
   =================================== */
.list-group-item {
    border: none;
    padding: 0.75rem 1rem;
    color: var(--dark-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    padding-left: 1.25rem;
}

.list-group-item.active {
    background-color: var(--primary-color);
    color: white;
    border-left: 3px solid var(--primary-color);
}

.list-group-item i {
    width: 1.25rem;
}

/* ===================================
   5. FORM ELEMENTS - Phần tử biểu mẫu
   =================================== */
.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-label .text-danger {
    margin-left: 0.25rem;
}

.form-control,
.form-select {
    border: 1px solid #dee2e6;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

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

.form-control::placeholder {
    color: #6c757d;
    font-style: italic;
}

/* ===================================
   6. INPUT GROUP - Nhóm input
   =================================== */
.input-group .form-control {
    border-right: none;
}

.input-group .btn-outline-secondary {
    border-left: none;
    background: white;
}

.input-group .btn-outline-secondary:hover {
    background: #f8f9fa;
}

.input-group .toggle-password {
    cursor: pointer;
}

/* ===================================
   7. PASSWORD FIELD - Trường mật khẩu
   =================================== */
.toggle-password {
    border: 1px solid #dee2e6;
    background: white;
}

.toggle-password:hover {
    background: #f8f9fa;
}

/* ===================================
   8. FORM FEEDBACK - Phản hồi biểu mẫu
   =================================== */
.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-control.is-invalid,
.form-select.is-invalid,
input.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.form-control.is-valid,
.form-select.is-valid,
input.is-valid {
    border-color: #198754 !important;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25) !important;
}

/* ===================================
   9. BUTTONS - Nút
   =================================== */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    transition: all 0.3s ease;
    border-radius: 0.375rem;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: #0b5ed7;
    border-color: #0b5ed7;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #bb2d3b;
    border-color: #bb2d3b;
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===================================
   10. FORM SWITCH - Switch checkbox
   =================================== */
.form-switch .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
    margin-top: 0.2rem;
}

.form-switch .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    margin-left: 0.5rem;
    cursor: pointer;
    color: var(--dark-color);
}

/* ===================================
   11. TAB CONTENT - Nội dung tab
   =================================== */
.tab-content {
    animation: fadeIn 0.3s ease;
}

.tab-content.hidden {
    display: none !important;
}

.tab-content.d-none {
    display: none !important;
}

.tab-content.active {
    display: block !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   12. CARD HEADER - Đầu thẻ
   =================================== */
.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 1.25rem;
}

.card-header h5 {
    font-weight: 600;
    margin: 0;
    color: var(--dark-color);
}

.card-header i {
    width: 1.5rem;
    text-align: center;
}

/* ===================================
   13. DANGER ZONE - Vùng nguy hiểm
   =================================== */
.card.border-danger {
    border: 2px solid #dc3545;
}

.card.border-danger .card-header {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.card.border-danger .card-header h5 {
    color: white;
}

/* ===================================
   14. MODAL - Cửa sổ nhỏ
   =================================== */
.modal-content {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem;
}

.modal-header.bg-danger {
    background-color: #dc3545 !important;
}

.modal-header h5 {
    font-weight: 600;
}

.modal-body {
    padding: 2rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1.5rem;
}

/* ===================================
   15. BREADCRUMB - Đường dẫn
   =================================== */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

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

.breadcrumb-item.active {
    color: var(--dark-color);
}

/* ===================================
   16. RESPONSIVE DESIGN - Thiết kế đáp ứng
   =================================== */
@media (max-width: 991.98px) {
    .profile-card {
        position: static !important;
        margin-bottom: 2rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn + .btn {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .list-group-item {
        display: inline-block;
        width: auto;
        margin-right: 0.5rem;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }

    .form-label {
        font-size: 0.9rem;
    }

    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }

    .row {
        gap: 0.5rem;
    }

    .col-md-6,
    .col-md-4 {
        margin-bottom: 1rem;
    }

    .stat-box {
        padding: 0.75rem;
    }

    .stat-box h6 {
        font-size: 1rem;
    }

    .btn-group {
        display: flex;
        flex-direction: column;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ===================================
   17. LOADING STATE - Trạng thái loading
   =================================== */
.btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.is-loading::after {
    content: '';
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    margin-left: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   18. SUCCESS MESSAGE - Thông báo thành công
   =================================== */
.alert {
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}
