/* profile.css - Production Ready v2.0 */

/* CSS Variables for theming */
:root {
    --profile-primary: #00ccff;
    --profile-secondary: #0099ff;
    --profile-danger: #ff4444;
    --profile-success: #00cc00;
    --profile-warning: #ff9900;
    --profile-bg: #1a1a1a;
    --profile-card-bg: #2a2a2a;
    --profile-text: #e0e0e0;
    --profile-border: #444;
    --profile-shadow: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    --profile-bg: #f5f5f5;
    --profile-card-bg: #ffffff;
    --profile-text: #333333;
    --profile-border: #dddddd;
    --profile-shadow: rgba(0, 0, 0, 0.1);
}

/* Base Styles */
#profile-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    color: var(--profile-text);
    font-family: 'Poppins', sans-serif;
    min-height: 70vh;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Profile Header */
.profile-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--profile-primary) 0%, var(--profile-secondary) 100%);
    border-radius: 16px;
    color: white;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: moveBackground 20s linear infinite;
    pointer-events: none;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(30px, 30px) rotate(360deg); }
}

.profile-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.profile-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.profile-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--profile-success);
    animation: pulse 2s infinite;
}

.status-indicator.active { background: var(--profile-success); }
.status-indicator.inactive { background: var(--profile-danger); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Profile Cards */
.profile-card, .orders-card {
    background: var(--profile-card-bg);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 30px var(--profile-shadow);
    margin-bottom: 30px;
    border: 1px solid var(--profile-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-card:hover, .orders-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 204, 255, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--profile-primary);
}

.card-header h3 {
    font-size: 1.5rem;
    color: var(--profile-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-count {
    background: var(--profile-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.card-body {
    padding: 10px 0;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--profile-border);
}

/* Detail Items */
.detail-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--profile-border);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--profile-primary);
    font-weight: 600;
    font-size: 1rem;
}

.detail-value {
    color: var(--profile-text);
    font-size: 1rem;
    word-break: break-word;
}

/* Action Buttons */
.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    min-width: 120px;
}

.action-btn i {
    font-size: 0.9rem;
}

.logout-btn {
    background: linear-gradient(45deg, var(--profile-danger), #ff6666);
    color: white;
}

.logout-btn:hover {
    background: linear-gradient(45deg, #ff2222, #ff4444);
    box-shadow: 0 6px 20px rgba(255, 68, 68, 0.4);
    transform: translateY(-2px);
}

.delete-btn {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    color: white;
}

.delete-btn:hover {
    background: linear-gradient(45deg, #ff5252, #ff7b7b);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    transform: translateY(-2px);
}

.login-btn {
    background: linear-gradient(45deg, var(--profile-primary), var(--profile-secondary));
    color: white;
    padding: 14px 32px;
    font-size: 1.1rem;
}

.login-btn:hover {
    background: linear-gradient(45deg, #00bbee, #0088dd);
    box-shadow: 0 6px 20px rgba(0, 204, 255, 0.4);
    transform: translateY(-2px);
}

.shop-btn {
    background: linear-gradient(45deg, #00cc00, #00aa00);
    color: white;
    margin-top: 15px;
}

.shop-btn:hover {
    background: linear-gradient(45deg, #00bb00, #009900);
    box-shadow: 0 6px 20px rgba(0, 204, 0, 0.4);
}

/* Orders List */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-item {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--profile-border);
    transition: all 0.3s ease;
}

.order-item:hover {
    border-color: var(--profile-primary);
    box-shadow: 0 4px 15px rgba(0, 204, 255, 0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.order-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.order-id {
    font-weight: 700;
    color: var(--profile-primary);
    font-size: 1.1rem;
}

.order-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending { background: rgba(255, 153, 0, 0.2); color: #ff9900; }
.status-processing { background: rgba(0, 204, 255, 0.2); color: var(--profile-primary); }
.status-shipped { background: rgba(0, 128, 255, 0.2); color: #0080ff; }
.status-delivered { background: rgba(0, 204, 0, 0.2); color: var(--profile-success); }
.status-cancelled { background: rgba(255, 68, 68, 0.2); color: var(--profile-danger); }

.order-dates {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--profile-text);
    opacity: 0.8;
}

.order-dates i {
    margin-right: 5px;
}

.order-details {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .order-details {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.order-items h4 {
    color: var(--profile-primary);
    margin-bottom: 10px;
    font-size: 1rem;
}

.order-items ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.order-items li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--profile-border);
    font-size: 0.9rem;
}

.order-items li:last-child {
    border-bottom: none;
}

.item-name {
    flex: 1;
    color: var(--profile-text);
}

.item-quantity {
    color: var(--profile-primary);
    font-weight: 600;
    margin: 0 15px;
}

.item-price {
    color: var(--profile-success);
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

.order-totals {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--profile-border);
    font-size: 0.95rem;
}

.total-row:last-child {
    border-bottom: none;
}

.grand-total {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--profile-success);
    padding-top: 15px;
    margin-top: 10px;
    border-top: 2px solid var(--profile-primary);
}

.order-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.view-order-btn, .reorder-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-width: auto;
}

.view-order-btn {
    background: var(--profile-card-bg);
    color: var(--profile-primary);
    border: 1px solid var(--profile-primary);
}

.view-order-btn:hover {
    background: var(--profile-primary);
    color: white;
}

.reorder-btn {
    background: var(--profile-success);
    color: white;
}

.reorder-btn:hover {
    background: #00bb00;
    box-shadow: 0 4px 15px rgba(0, 204, 0, 0.3);
}

/* No Orders State */
.no-orders {
    text-align: center;
    padding: 40px 20px;
}

.no-orders i {
    font-size: 4rem;
    color: var(--profile-border);
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-orders p {
    font-size: 1.2rem;
    color: var(--profile-text);
    opacity: 0.7;
    margin-bottom: 25px;
}

/* Order Summary */
.order-summary-total {
    background: linear-gradient(135deg, rgba(0, 204, 255, 0.1), rgba(0, 153, 255, 0.1));
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 1rem;
}

.summary-item:first-child {
    font-weight: 600;
    color: var(--profile-primary);
}

/* Profile Empty State */
.profile-empty {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.profile-empty h2 {
    font-size: 2rem;
    color: var(--profile-primary);
    margin-bottom: 20px;
}

.profile-empty p {
    font-size: 1.1rem;
    color: var(--profile-text);
    opacity: 0.8;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Toast System */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 350px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: linear-gradient(45deg, var(--profile-success), #00aa00);
}

.toast-error {
    background: linear-gradient(45deg, var(--profile-danger), #ff2222);
}

.toast-info {
    background: linear-gradient(45deg, var(--profile-primary), var(--profile-secondary));
}

.toast-warning {
    background: linear-gradient(45deg, var(--profile-warning), #ff7700);
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 204, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--profile-primary);
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    #profile-container {
        margin: 20px auto;
        padding: 15px;
    }
    
    .profile-header h2 {
        font-size: 1.8rem;
    }
    
    .profile-header p {
        font-size: 1rem;
    }
    
    .profile-card, .orders-card {
        padding: 20px;
    }
    
    .detail-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .card-footer {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .order-dates {
        flex-direction: column;
        gap: 5px;
    }
    
    .order-summary-total {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .profile-header {
        padding: 20px 15px;
    }
    
    .profile-header h2 {
        font-size: 1.5rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .order-actions {
        flex-direction: column;
    }
}

/* Print Styles */
@media print {
    .profile-header,
    .card-footer,
    .order-actions,
    .action-btn,
    .toast {
        display: none !important;
    }
    
    .profile-card, .orders-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    body {
        color: black;
        background: white;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .profile-header::before {
        animation: none;
    }
    
    .status-indicator {
        animation: none;
    }
}