/*
 * Devicel Account Stylesheet
 * Dashboard, Orders, KYC, Profile
 * Version: 1.0.0
 */

/* ========================================
   Account Layout
   ======================================== */
.account-page {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--space-8);
    align-items: start;
}

/* ========================================
   Account Sidebar
   ======================================== */
.account-sidebar {
    position: sticky;
    top: 100px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.account-user {
    padding: var(--space-5);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.account-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-3);
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-bold);
}

.account-user h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-1);
}

.account-user p {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: 0;
}

.account-nav {
    padding: var(--space-3);
}

.account-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    font-weight: var(--font-medium);
    transition: all var(--transition-base);
    text-decoration: none;
}

.account-nav-item:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.account-nav-item.active {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    color: var(--primary);
}

.account-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.account-nav-item .badge {
    margin-left: auto;
    background: var(--primary);
    color: var(--text-white);
    font-size: var(--font-size-xs);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.account-nav-divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-3) 0;
}

/* ========================================
   Account Content
   ======================================== */
.account-content {
    min-height: 500px;
}

.account-header {
    margin-bottom: var(--space-6);
}

.account-header h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-2);
}

.account-header p {
    color: var(--text-muted);
    font-size: var(--font-size-lg);
    margin: 0;
}

/* ========================================
   Dashboard Stats
   ======================================== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all var(--transition-base);
}

.stat-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: var(--space-4);
}

.stat-card-value {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--space-1);
}

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

/* ========================================
   Recent Orders Widget
   ======================================== */
.account-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-6);
}

.account-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5);
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
}

.account-section-header h2 {
    font-size: var(--font-size-xl);
    margin: 0;
}

.account-section-header a {
    font-size: var(--font-size-sm);
    color: var(--primary);
    font-weight: var(--font-medium);
}

.account-section-body {
    padding: var(--space-5);
}

/* ========================================
   Orders Table
   ======================================== */
.orders-table {
    width: 100%;
}

.orders-table th,
.orders-table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.orders-table th {
    font-size: var(--font-size-sm);
    font-weight: var(--font-semibold);
    color: var(--text-muted);
    background: var(--bg-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.orders-table tr:last-child td {
    border-bottom: none;
}

.orders-table tr:hover td {
    background: var(--bg-light);
}

.order-id {
    font-weight: var(--font-semibold);
    color: var(--primary);
}

.order-date {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.order-amount {
    font-weight: var(--font-semibold);
}

/* Order Status */
.order-status {
    display: inline-flex;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
}

.order-status.pending {
    background: var(--warning-light);
    color: #92400e;
}

.order-status.processing {
    background: var(--info-light);
    color: #1e40af;
}

.order-status.completed,
.order-status.paid {
    background: var(--success-light);
    color: #065f46;
}

.order-status.cancelled {
    background: var(--error-light);
    color: #991b1b;
}

.order-status.shipped {
    background: #ede9fe;
    color: #6d28d9;
}

/* Order Actions */
.order-actions {
    display: flex;
    gap: var(--space-2);
}

.order-actions .btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
}

/* ========================================
   Order Detail
   ======================================== */
.order-detail {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--space-6);
}

.order-items {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.order-item {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
}

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

.order-item-image {
    width: 80px;
    height: 80px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.order-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-item-details {
    flex: 1;
}

.order-item-title {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
}

.order-item-sku {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.order-item-qty {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.order-item-price {
    font-weight: var(--font-semibold);
    text-align: right;
}

.order-summary-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.order-info-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.order-info-card h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}

.order-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    font-size: var(--font-size-base);
}

.order-info-row:last-child {
    margin-bottom: 0;
}

.order-info-row .label {
    color: var(--text-muted);
}

.order-info-row .value {
    font-weight: var(--font-medium);
}

.order-info-row.total {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    font-size: var(--font-size-lg);
    font-weight: var(--font-bold);
}

.order-info-row.total .value {
    color: var(--primary);
}

/* ========================================
   KYC Form
   ======================================== */
.kyc-page {
    max-width: 700px;
}

.kyc-status {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.kyc-status-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.kyc-status.pending .kyc-status-icon {
    background: var(--warning-light);
}

.kyc-status.verified .kyc-status-icon {
    background: var(--success-light);
}

.kyc-status.rejected .kyc-status-icon {
    background: var(--error-light);
}

.kyc-status-content h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-1);
}

.kyc-status-content p {
    color: var(--text-muted);
    font-size: var(--font-size-base);
    margin: 0;
}

.kyc-form {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.kyc-form h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.kyc-section {
    margin-bottom: var(--space-8);
}

.kyc-section:last-child {
    margin-bottom: 0;
}

.kyc-section h3 {
    font-size: var(--font-size-lg);
    color: var(--primary);
    margin-bottom: var(--space-4);
}

.kyc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.kyc-grid .full-width {
    grid-column: 1 / -1;
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-5);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.file-upload:hover {
    border-color: var(--primary);
    background: var(--bg-light);
}

.file-upload-icon {
    font-size: 40px;
    margin-bottom: var(--space-3);
    color: var(--text-muted);
}

.file-upload-text {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

.file-upload-hint {
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

.file-upload input[type="file"] {
    display: none;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-top: var(--space-3);
}

.file-preview-icon {
    font-size: 24px;
}

.file-preview-name {
    flex: 1;
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
}

.file-preview-remove {
    color: var(--error);
    cursor: pointer;
}

/* ========================================
   Profile Settings
   ======================================== */
.profile-form {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.profile-section {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid var(--border);
}

.profile-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.profile-section h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-5);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

/* Avatar Upload */
.avatar-upload {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.avatar-preview {
    width: 100px;
    height: 100px;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-bold);
    flex-shrink: 0;
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* ========================================
   Empty States
   ======================================== */
.account-empty {
    text-align: center;
    padding: var(--space-16) var(--space-5);
}

.account-empty-icon {
    font-size: 64px;
    margin-bottom: var(--space-5);
}

.account-empty h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-2);
}

.account-empty p {
    color: var(--text-muted);
    margin-bottom: var(--space-6);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .account-page {
        grid-template-columns: 1fr;
    }
    
    .account-sidebar {
        position: static;
    }
    
    .account-nav {
        display: flex;
        gap: var(--space-2);
        overflow-x: auto;
        padding: var(--space-3);
    }
    
    .account-nav-item {
        white-space: nowrap;
    }
    
    .account-user {
        display: none;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .order-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .kyc-grid,
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .orders-table {
        display: block;
    }
    
    .orders-table thead {
        display: none;
    }
    
    .orders-table tbody,
    .orders-table tr,
    .orders-table td {
        display: block;
    }
    
    .orders-table tr {
        padding: var(--space-4);
        border-bottom: 1px solid var(--border);
    }
    
    .orders-table td {
        padding: var(--space-2) 0;
        border: none;
        display: flex;
        justify-content: space-between;
    }
    
    .orders-table td::before {
        content: attr(data-label);
        font-weight: var(--font-medium);
        color: var(--text-muted);
    }
    
    .avatar-upload {
        flex-direction: column;
        text-align: center;
    }
}
