/* Profile Page Styles */

.profile-main {
    min-height: calc(100vh - 200px);
    padding: 2rem 1rem;
    background: var(--background);
}

.profile-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Profile Header */
.profile-header {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-header-info {
    flex: 1;
}

.profile-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.profile-email {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.profile-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
}

.profile-badge.admin {
    background: #fef3c7;
    color: #d97706;
}

.btn-edit-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit-profile:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
}

.profile-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.profile-tab:hover {
    color: var(--primary-color);
}

.profile-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Tab Panels */
.profile-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-card {
    padding: 1.5rem;
    background: var(--background);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.info-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.info-value {
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Security Section */
.security-section {
    max-width: 600px;
}

.security-section h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.security-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.security-form .form-group {
    margin-bottom: 1.5rem;
}

.security-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.security-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.security-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Password Input Wrapper with Toggle */
.security-form .password-input-wrapper {
    position: relative;
    width: 100%;
}

.security-form .password-input-wrapper input {
    padding-right: 3rem;
}

.security-form .password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    z-index: 10;
}

.security-form .password-toggle-btn:hover {
    color: var(--text-primary);
}

.security-form .password-toggle-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.security-form .password-toggle-btn svg {
    width: 20px;
    height: 20px;
}

/* Orders Page */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--text-secondary);
}

.orders-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.order-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.order-info {
    flex: 1;
}

.order-number {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.order-date {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.order-status {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
}

.order-status.pending {
    background: #fef3c7;
    color: #d97706;
}

.order-status.processing {
    background: #dbeafe;
    color: #2563eb;
}

.order-status.shipped {
    background: #e0e7ff;
    color: #6366f1;
}

.order-status.delivered {
    background: #d1fae5;
    color: #059669;
}

.order-status.cancelled {
    background: #fee2e2;
    color: #dc2626;
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.order-item {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.order-item-image {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

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

.order-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.order-item-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.order-item-price {
    font-weight: 700;
    color: var(--primary-color);
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.order-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.order-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-order-action {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-order-action:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.empty-state svg {
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 1.5rem;
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .profile-avatar-section {
        width: 100%;
    }
    
    .btn-edit-profile {
        width: 100%;
        justify-content: center;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .order-header {
        flex-direction: column;
    }
    
    .order-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
