/* Dashboard Page */
.dashboard-page {
    padding: 2rem 0;
    animation: fadeInUp 0.5s ease-out;
}

/* Welcome Section */
.dashboard-welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    border: none;
    color: white;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}

.welcome-content h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: white;
}

.welcome-content p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 1.1rem;
}

.welcome-actions {
    display: flex;
    gap: 1.25rem;
}

.welcome-actions .btn-primary {
    background-color: white;
    color: #3b82f6;
    border: none;
    font-weight: 600;
}

.welcome-actions .btn-primary:hover {
    background-color: #f8fafc;
    transform: translateY(-2px);
}

.welcome-actions .btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
}

.welcome-actions .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: translateY(-2px);
}

/* Stats Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-accent);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    /* Prevent distortion on zoom/smaller screens */
}

.stat-icon.total-rooms {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
}

.stat-icon.active-rooms {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-icon.pending-rooms {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.stat-icon.total-views {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.stat-icon.total-calls {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
}

.stat-info h3 {
    font-size: 1.8rem;
    margin: 0;
    line-height: 1;
}

.stat-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-trend {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--secondary-accent);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Global Helpers within Dashboard */
.hidden {
    display: none !important;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-accent);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-base);
}

.btn-text:hover {
    color: var(--primary-accent-hover);
}

.notification-empty {
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
}

/* Dashboard Content Grid */
.dashboard-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

@media (min-width: 1024px) {
    .dashboard-content {
        grid-template-columns: 350px 1fr;
    }
}

/* Left Column */
.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Verification Card */
.verification-card,
.quick-actions-card,
.activity-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.verification-header,
.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.verification-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.verification-badge.verified {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.verification-badge.not-verified {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: var(--bg-secondary);
    margin-bottom: 1rem;
}

.progress-item.completed .progress-icon {
    background: #22c55e;
    color: white;
}

.progress-item.pending .progress-icon {
    background: #eab308;
    color: white;
}

.progress-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.progress-info h4 {
    margin: 0;
    font-size: 0.95rem;
}

.progress-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Quick Actions */
.actions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.3s ease;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.action-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.action-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.action-icon.add-room {
    background: #38bdf8;
}

.action-icon.photos {
    background: #a855f7;
}

.action-icon.promote {
    background: #f43f5e;
}

.action-icon.analytics {
    background: #eab308;
}

.action-info h4 {
    margin: 0;
    font-size: 1rem;
}

.action-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-accent);
}

.activity-info h4 {
    margin: 0 0 0.2rem 0;
    font-size: 0.95rem;
}

.activity-info p {
    margin: 0 0 0.2rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Right Column */
.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.rooms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.rooms-filter {
    display: flex;
    gap: 1rem;
}

.rooms-table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow-x: auto !important;
    /* Fixed: was hidden, blocking horizontal scroll */
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-sm);
}

.rooms-table {
    width: 100%;
    min-width: 800px;
    /* Ensure table doesn't collapse too much */
    border-collapse: collapse;
    table-layout: auto;
}

.rooms-table th,
.rooms-table td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.rooms-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.room-info-cell {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.room-image-small {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.room-image-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.room-details h4 {
    margin: 0 0 0.2rem 0;
    font-size: 1rem;
}

.room-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.status-badge.pending {
    background: rgba(234, 179, 8, 0.1);
    color: var(--warning);
}

.status-badge.inactive {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
}

.action-buttons-cell {
    display: flex;
    gap: var(--space-sm);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.btn-icon:hover {
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    background: var(--bg-tertiary);
}

/* Performance Card */
.performance-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.performance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.performance-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric {
    text-align: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-accent);
    margin-bottom: 0.2rem;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.metric-change {
    font-size: 0.8rem;
    font-weight: 600;
}

.metric-change.positive {
    color: #22c55e;
}

.metric-change.negative {
    color: #ef4444;
}

.performance-chart {
    height: 300px;
    width: 100%;
}

/* Recovered Modal Styles and others */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 95%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-header i {
    color: var(--primary-accent);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: var(--space-xl);
}

/* Room Actions Modal */
.room-info-summary {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.room-info-summary h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-lg);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-base);
}

.action-btn:hover {
    border-color: var(--primary-accent);
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn.delete {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.action-btn.delete:hover {
    background-color: rgba(239, 68, 68, 0.05);
    border-color: var(--danger);
}

.action-btn i {
    font-size: 1.2rem;
}

.action-btn span {
    font-size: 0.9rem;
    font-weight: 600;
}

.room-stats {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-color);
}

.room-stats h4 {
    text-align: center;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-accent);
    margin-bottom: var(--space-xs);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Verification Steps */
.verification-steps {
    margin-bottom: 1.5rem;
}

.step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--primary-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.step-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    border-color: var(--primary-accent);
    background-color: rgba(56, 189, 248, 0.05);
}

.upload-area i {
    font-size: 2rem;
    color: var(--primary-accent);
    margin-bottom: 1rem;
}

.upload-area p {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-area span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .dashboard-welcome {
        flex-direction: column;
        text-align: center;
        gap: var(--space-lg);
    }

    .welcome-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .stat-card {
        padding: var(--space-md);
        gap: var(--space-sm);
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .stat-info h3 {
        font-size: 1.5rem;
    }

    .rooms-table {
        display: block;
        overflow-x: auto;
    }
}

/* Message Modal Split Layout (Responsive Fix) */
.message-list-sidebar {
    width: 35%;
    border-right: 1px solid var(--border-color, #e5e7eb);
    overflow-y: auto;
    background: var(--bg-tertiary, #f9fafb);
}

.message-detail-content {
    width: 65%;
    padding: var(--space-xl);
    overflow-y: auto;
}

@media (max-width: 768px) {
    .message-modal-body {
        flex-direction: column !important;
    }

    .message-list-sidebar {
        width: 100% !important;
        height: 250px !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color, #e5e7eb) !important;
    }

    .message-detail-content {
        width: 100% !important;
        height: auto !important;
        padding: var(--space-lg) !important;
    }
}