/**
 * Orders Page Styles
 * Client orders list and single order view
 */

/* ========================================
   ORDERS PAGE LAYOUT
   ======================================== */

.orders-page {
    padding: 50px 0;
    position: relative;
}

.orders-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 107, 53, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ========================================
   ORDERS HERO
   ======================================== */

.orders-hero {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #0d0d0d 100%);
}

.orders-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255,107,0,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255,140,0,0.1) 0%, transparent 50%);
    animation: ordersHeroGlow 4s ease-in-out infinite alternate;
}

@keyframes ordersHeroGlow {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.orders-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, var(--bg-dark), transparent);
}

.orders-hero__content {
    position: relative;
    z-index: 1;
    padding: 40px 20px;
}

.orders-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(255,107,0,0.2), rgba(255,140,0,0.1));
    color: var(--primary);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid rgba(255,107,0,0.3);
}

.orders-hero__title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 10px;
}

.orders-hero__subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* ========================================
   PAGE HEADER
   ======================================== */

.page-header {
    margin-bottom: 35px;
}

.page-header h1 {
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: var(--font-display);
    font-weight: 700;
    flex-wrap: wrap;
}

.page-header h1 i {
    color: var(--primary);
}

/* ========================================
   ORDERS LIST
   ======================================== */

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   ORDER CARD
   ======================================== */

.order-card {
    background: var(--gradient-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-smooth);
}

.order-card:hover {
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.order-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 15px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.03) 0%, transparent 50%);
}

.order-card__info h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.order-card__meta {
    display: flex;
    gap: 18px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: var(--font-body);
}

.order-card__body {
    padding: 22px 24px;
}

.order-card__items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.order-card__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.order-card__item:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: rgba(255, 107, 53, 0.2);
}

.order-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: var(--bg-secondary);
}

.order-card__total {
    font-weight: 600;
}

.order-card__total span {
    color: var(--primary);
    font-size: 1.25rem;
}

/* ========================================
   ORDER STATUS BADGES
   ======================================== */

.order-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
}

.order-status--pending {
    background: rgba(255,193,7,0.15);
    color: #ffc107;
}

.order-status--accepted {
    background: rgba(0,123,255,0.15);
    color: #007bff;
}

.order-status--preparing {
    background: rgba(255,107,0,0.15);
    color: var(--primary);
}

.order-status--ready {
    background: rgba(23,162,184,0.15);
    color: #17a2b8;
}

.order-status--picked_up {
    background: rgba(108,117,125,0.15);
    color: #6c757d;
}

.order-status--delivering {
    background: rgba(255,140,0,0.15);
    color: #ff8c00;
}

.order-status--delivered {
    background: rgba(40,167,69,0.15);
    color: #28a745;
}

.order-status--cancelled {
    background: rgba(220,53,69,0.15);
    color: #dc3545;
}

/* ========================================
   SINGLE ORDER VIEW
   ======================================== */

.order-detail {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

@media (max-width: 992px) {
    .order-detail {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   ORDER SECTION (Card Component)
   ======================================== */

.order-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.order-section__header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.order-section__title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-section__body {
    padding: 20px;
}

/* ========================================
   ORDER TIMELINE
   ======================================== */

.order-timeline {
    position: relative;
    padding-left: 30px;
}

.order-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 25px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item__dot {
    position: absolute;
    left: -25px;
    top: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.timeline-item--completed .timeline-item__dot {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.timeline-item--active .timeline-item__dot {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    animation: timelinePulse 2s infinite;
}

@keyframes timelinePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,0,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255,107,0,0); }
}

.timeline-item__content {
    margin-left: 10px;
}

.timeline-item__title {
    font-weight: 600;
    margin-bottom: 2px;
}

.timeline-item__time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ========================================
   ORDER ITEMS LIST
   ======================================== */

.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.order-item__image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.order-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-item__info {
    flex: 1;
}

.order-item__name {
    font-weight: 500;
    margin-bottom: 4px;
}

.order-item__qty {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.order-item__price {
    font-weight: 600;
    color: var(--primary);
}

/* ========================================
   INFO CARD
   ======================================== */

.info-card {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.info-card:last-child {
    margin-bottom: 0;
}

.info-card__label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.info-card__value {
    font-weight: 500;
}

.info-card__value a {
    color: var(--primary);
}

/* ========================================
   EMPTY STATE
   ======================================== */

.empty-orders {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.empty-orders__icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-orders__title {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-orders__text {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .orders-page {
        padding: 30px 0;
    }
    
    .orders-hero {
        min-height: 150px;
    }
    
    .orders-hero__content {
        padding: 30px 15px;
    }
    
    .orders-hero__badge {
        font-size: 0.8rem;
        padding: 8px 16px;
        gap: 8px;
    }
    
    .orders-hero__title {
        font-size: 1.5rem;
    }
    
    .orders-hero__subtitle {
        font-size: 0.95rem;
    }
    
    /* Orders Grid */
    .orders-grid {
        gap: 15px;
    }
    
    /* Order Card */
    .order-card {
        border-radius: var(--radius-md);
    }
    
    .order-card__header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .order-card__id {
        font-size: 1rem;
    }
    
    .order-card__body {
        padding: 15px;
    }
    
    .order-card__footer {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .order-card__total {
        font-size: 1.1rem;
        width: 100%;
    }
    
    .order-card__actions {
        width: 100%;
    }
    
    .order-card__actions .btn {
        flex: 1;
    }
    
    /* Order Detail */
    .order-section__header,
    .order-section__body {
        padding: 15px;
    }
    
    .order-section__title {
        font-size: 1rem;
    }
    
    /* Timeline */
    .order-timeline {
        padding-left: 25px;
    }
    
    .timeline-item__time {
        font-size: 0.75rem;
    }
    
    .timeline-item__content h4 {
        font-size: 0.9rem;
    }
    
    /* Order Item */
    .order-item {
        gap: 12px;
        padding: 10px;
    }
    
    .order-item__image {
        width: 50px;
        height: 50px;
    }
    
    .order-item__name {
        font-size: 0.9rem;
    }
    
    .order-item__qty {
        font-size: 0.8rem;
    }
    
    .order-item__price {
        font-size: 0.9rem;
    }
    
    /* Info Card */
    .info-card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .info-card__label {
        font-size: 0.8rem;
    }
    
    .info-card__value {
        font-size: 0.9rem;
    }
    
    /* Empty State */
    .empty-orders {
        padding: 50px 20px;
    }
    
    .empty-orders__icon {
        font-size: 3rem;
    }
    
    .empty-orders__title {
        font-size: 1.25rem;
    }
    
    .empty-orders__text {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .orders-page {
        padding: 20px 0;
    }
    
    .orders-hero {
        min-height: 120px;
    }
    
    .orders-hero__content {
        padding: 25px 15px;
    }
    
    .orders-hero__badge {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    
    .orders-hero__title {
        font-size: 1.3rem;
    }
    
    .orders-hero__subtitle {
        font-size: 0.85rem;
    }
    
    /* Order Card */
    .order-card__header,
    .order-card__body,
    .order-card__footer {
        padding: 12px;
    }
    
    .order-card__meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .order-card__total {
        font-size: 1rem;
    }
    
    /* Order Section */
    .order-section__header,
    .order-section__body {
        padding: 12px;
    }
    
    /* Timeline */
    .order-timeline {
        padding-left: 22px;
    }
    
    .timeline-item {
        padding-bottom: 20px;
    }
    
    /* Order Item */
    .order-item__image {
        width: 45px;
        height: 45px;
    }
    
    /* Empty State */
    .empty-orders {
        padding: 40px 15px;
    }
    
    .empty-orders__icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
    
    .empty-orders__title {
        font-size: 1.15rem;
    }
    
    .empty-orders__text {
        margin-bottom: 20px;
    }
}

@media (max-width: 375px) {
    .orders-hero__title {
        font-size: 1.2rem;
    }
    
    .order-card__id {
        font-size: 0.95rem;
    }
    
    .order-item__name {
        font-size: 0.85rem;
    }
}
