@import url("../css-template.css");

main {
    display: flex;
    justify-content: center;
    padding: 2rem;
    padding-top: calc(56px + 2rem);
    flex: 1;
}

@media (min-width: 769px) {
    main {
        padding-left: calc(220px + 2rem);
    }
}

.home-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ── Hero Card ── */
.hero-card {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 8px 30px rgba(212, 96, 58, 0.25);
}

.hero-left .greeting {
    font-size: 1rem;
    opacity: 0.85;
    margin-bottom: 0.25rem;
}

.hero-left h1 {
    font-size: 2rem;
    margin: 0 0 0.75rem 0;
    letter-spacing: -0.5px;
}

.datetime-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.separator {
    opacity: 0.4;
}

.hero-right {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hero-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chat-btn {
    background: white;
    color: var(--accent);
}

.chat-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--accent);
}

.orders-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.orders-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    color: white;
}

/* ── Stats Row ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Orders Panel ── */
.orders-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text);
}

.view-all-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.2s;
}

.view-all-link:hover {
    gap: 0.5rem;
}

.orders-list {
    display: flex;
    flex-direction: column;
}

.order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.order-row:last-child {
    border-bottom: none;
}

.order-row:hover {
    background: var(--surface-2);
}

.order-row-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.order-row-name {
    font-weight: bold;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-row-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Stage badges */
.status {
    padding: 3px 10px;
    border-radius: var(--radius);
    font-weight: bold;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.stage-pending     { color: #e6a817; background: rgba(255,200,87,0.15); }
.stage-deposit     { color: #e67e22; background: rgba(230,126,34,0.1); }
.stage-deposit-paid { color: var(--green); background: rgba(76,175,80,0.1); }
.stage-progress    { color: var(--accent); background: var(--accent-glow); }
.stage-late        { color: #dc2727; background: rgba(220,39,39,0.1); }
.stage-payment     { color: #e67e22; background: rgba(230,126,34,0.1); }
.stage-completed   { color: var(--green); background: rgba(76,175,80,0.1); }
.stage-cancelled   { color: #999; background: rgba(153,153,153,0.1); }

/* Empty / Loading states */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    display: block;
}

.empty-state p {
    margin-bottom: 1rem;
}

.empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.empty-cta:hover {
    background: var(--accent-hover);
    color: white;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    main {
        padding: 1rem;
        padding-top: calc(56px + 1rem);
        padding-left: 1rem;
    }

    .hero-card {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 2rem 1.5rem;
    }

    .hero-left h1 {
        font-size: 1.6rem;
    }

    .datetime-row {
        justify-content: center;
    }

    .hero-right {
        flex-direction: row;
        width: 100%;
    }

    .hero-btn {
        flex: 1;
        justify-content: center;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .order-row-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .order-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero-card {
        padding: 1.5rem 1.25rem;
    }

    .hero-left h1 {
        font-size: 1.35rem;
    }

    .hero-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.85rem;
        gap: 0.7rem;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.72rem;
    }

    .panel-header {
        padding: 1rem;
    }

    .panel-header h2 {
        font-size: 1rem;
    }

    .order-row {
        padding: 0.85rem 1rem;
    }

    .order-row-meta {
        font-size: 0.82rem;
        gap: 0.75rem;
    }
}

/* ── Review Banner ── */
@keyframes reviewSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.review-banner {
    background: rgba(76, 175, 80, 0.07);
    border: 1px solid rgba(76, 175, 80, 0.18);
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    animation: reviewSlideDown 0.3s ease;
}

.review-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.review-banner-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text);
}

.review-banner-left i {
    color: #4CAF50;
    font-size: 1rem;
    flex-shrink: 0;
}

.review-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.review-banner-cta {
    background: #4CAF50;
    color: white;
    padding: 0.28rem 0.7rem;
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s;
}

.review-banner-cta:hover { background: #43a047; color: white; }

.review-banner-snooze {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0.28rem 0.4rem;
    font-family: inherit;
    transition: color 0.15s;
}

.review-banner-snooze:hover { color: var(--text); }

.review-banner-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.15s;
}

.review-banner-dismiss:hover { color: var(--text); }
