/* Dashboard Page Styles */

.dashboard-body {
    background: #f5f0ff;
    min-height: 100vh;
}

.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 72px);
    padding-top: 72px; /* matches actual navbar height; JS will override precisely */
}

/* ── Sidebar ───────────────────────────────────────────── */
.dashboard-sidebar {
    width: 260px;
    min-width: 260px;
    background: white;
    border-right: 1px solid #e8e0ff;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    position: sticky;
    top: 72px; /* JS will override */
    height: calc(100vh - 72px);
    overflow-y: auto;
}

.user-card {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f0ebff;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c4dff, #b388ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    margin-bottom: 0.75rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.user-email {
    font-size: 0.8rem;
    color: var(--light-text);
    word-break: break-all;
}

/* Sidebar nav — styled to match the main site's navbar links */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.25rem;
    flex: 1;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: color 0.2s ease;
    border: none;
    border-bottom: 1px solid transparent;
    background: transparent;
    width: 100%;
    text-align: left;
    border-radius: 0;
}

.sidebar-nav-item i {
    width: 18px;
    color: var(--light-text);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.sidebar-nav-item:hover {
    color: var(--primary-color);
    background: transparent;
}

.sidebar-nav-item:hover i {
    color: var(--primary-color);
}

.sidebar-nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
}

.sidebar-nav-item.active i {
    color: var(--primary-color);
}

.sidebar-nav-item.logout-btn {
    color: var(--light-text);
    margin-top: 0.5rem;
}

.sidebar-nav-item.logout-btn:hover {
    color: #c62828;
    background: transparent;
}

.sidebar-nav-item.logout-btn:hover i {
    color: #c62828;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid #f0ebff;
    margin: 0.5rem 0;
}

/* ── Main content ─────────────────────────────────────── */
.dashboard-main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    font-size: 1.8rem;
}

/* ── Cards ────────────────────────────────────────────── */
.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(124, 77, 255, 0.08);
    margin-bottom: 1rem;
}

/* ── Appointment list ─────────────────────────────────── */
.appointment-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f5f0ff;
}

.appointment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.appt-date-box {
    background: #ede7ff;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    text-align: center;
    min-width: 60px;
    flex-shrink: 0;
}

.appt-date-box .month {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
}

.appt-date-box .day {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.appt-info {
    flex: 1;
}

.appt-service {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.2rem;
}

.appt-time {
    font-size: 0.85rem;
    color: var(--light-text);
    margin-bottom: 0.4rem;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-pending    { background: #fff3e0; color: #e65100; }
.status-confirmed  { background: #e8f5e9; color: #2e7d32; }
.status-completed  { background: #e3f2fd; color: #1565c0; }
.status-cancelled  { background: #fce4ec; color: #ad1457; }

/* ── Messages / Chat ──────────────────────────────────── */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    border: 1.5px solid #e8e0ff;
    border-radius: 12px;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #7c4dff, #9c6fff);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-header .anju-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.5);
}

.chat-header-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.chat-header-info p {
    font-size: 0.75rem;
    opacity: 0.85;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #fdfbff;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message-bubble {
    max-width: 75%;
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.message-bubble.client {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-bubble.anju {
    background: white;
    color: var(--text-color);
    border: 1px solid #e8e0ff;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.68rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.message-bubble.client .message-time {
    text-align: right;
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid #e8e0ff;
    background: white;
}

.chat-input-area textarea {
    flex: 1;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    height: 42px;
    max-height: 100px;
    overflow-y: auto;
    transition: border-color 0.2s;
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.send-btn {
    padding: 0 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
    height: 42px;
}

.send-btn:hover {
    background: #6c3fd6;
}

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

.no-messages {
    text-align: center;
    color: var(--light-text);
    font-size: 0.9rem;
    padding: 2rem;
}

/* ── Reviews ──────────────────────────────────────────── */
.review-card {
    border-left: 3px solid var(--primary-color);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    background: #fdfbff;
    border-radius: 0 10px 10px 0;
}

.review-rating {
    color: #ffd700;
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.review-comment {
    font-style: italic;
    color: var(--text-color);
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

.review-meta {
    font-size: 0.8rem;
    color: var(--light-text);
}

/* ── Review form in dashboard ─────────────────────────── */
.star-picker {
    display: flex;
    gap: 4px;
    margin-bottom: 0.25rem;
}

.star-picker .star {
    font-size: 1.8rem;
    cursor: pointer;
    color: #ddd;
    transition: color 0.15s;
    line-height: 1;
}

.star-picker .star.selected,
.star-picker .star.hovered {
    color: #ffd700;
}

/* ── Profile form ─────────────────────────────────────── */
.profile-form .form-group {
    margin-bottom: 1.1rem;
}

.profile-form .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--text-color);
}

.profile-form .form-group input,
.profile-form .form-group select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.profile-form .form-group input:focus,
.profile-form .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.profile-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.save-btn {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.save-btn:hover {
    background: #6c3fd6;
}

/* ── Empty states ─────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--light-text);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #c5b3ff;
}

.empty-state p {
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

/* ── Loading spinner ──────────────────────────────────── */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--light-text);
    gap: 0.5rem;
}

.loading-spinner i {
    animation: spin 1s linear infinite;
}

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

/* ── Toast ────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #333;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 9999;
    animation: slide-in 0.3s ease;
}

.toast.success { background: #2e7d32; }
.toast.error   { background: #c62828; }

@keyframes slide-in {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .dashboard-layout {
        padding-top: 0;
    }

    .dashboard-sidebar {
        width: 100%;
        min-width: unset;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 2px solid #e8e0ff;
        padding: 0.75rem 0;
    }

    .user-card {
        padding: 0.75rem 1.25rem;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0;
        padding: 0 1rem;
    }

    .sidebar-nav-item {
        flex: none;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
        border-bottom: none;
    }

    .sidebar-nav-item.active {
        border-bottom: 2px solid var(--primary-color);
    }

    .dashboard-main {
        padding: 1rem;
    }

    .profile-form .form-row {
        grid-template-columns: 1fr;
    }
}
