/**
 * My Orders Page Styles
 * Customer personal account
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(195deg, #f8f9fa 0%, #dee2e6 100%);
    min-height: 100vh;
    padding: 20px;
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header h1 {
    color: #344767;
    font-size: 32px;
    font-weight: 700;
}

.back-link {
    color: #344767;
    text-decoration: none;
    font-size: 16px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

/* Auth Form */
.auth-form {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.form-card {
    background: white;
    border-radius: 16px;
    padding: 48px 40px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.form-card h2 {
    font-size: 28px;
    margin-bottom: 12px;
    color: #2d3748;
}

.form-description {
    color: #718096;
    margin-bottom: 32px;
    font-size: 15px;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #2d3748;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.form-note {
    text-align: center;
    color: #718096;
    font-size: 13px;
    margin-top: 24px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(195deg, #49a3f1 0%, #1A73E8 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #e2e8f0;
    color: #2d3748;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

/* Customer Account */
.account-header {
    background: white;
    border-radius: 16px;
    padding: 24px 32px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.customer-info h2 {
    color: #344767;
    font-size: 24px;
    margin-bottom: 4px;
}

.customer-phone {
    color: #67748e;
    font-size: 14px;
}

.account-actions {
    display: flex;
    gap: 12px;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 20px;
    background: white;
    border-radius: 16px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading p {
    margin-top: 16px;
    color: #718096;
}

/* Orders Workspace */
.orders-workspace {
    display: flex;
    gap: 24px;
    min-height: 600px;
}

/* Orders Sidebar */
.orders-sidebar {
    width: 400px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 27px 0 rgba(0,0,0,0.05);
    overflow: hidden;
}

.sidebar-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f0f2f5;
    background: linear-gradient(195deg, #f8f9fa 0%, #f0f2f5 100%);
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #344767;
    margin-bottom: 8px;
}

.orders-count {
    font-size: 14px;
    color: #67748e;
}

.sidebar-orders-list {
    max-height: calc(600px - 80px);
    overflow-y: auto;
}

.sidebar-order-item {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-order-item:hover {
    background: #f8f9fa;
}

.sidebar-order-item.active {
    background: linear-gradient(195deg, #49a3f1 0%, #1A73E8 100%);
    color: white;
}

.sidebar-order-item.active .order-item-number {
    color: white;
}

.sidebar-order-item.active .order-item-date {
    color: rgba(255,255,255,0.8);
}

.sidebar-order-item.active .order-item-total {
    color: white;
}

.order-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.order-item-number {
    font-size: 16px;
    font-weight: 600;
    color: #344767;
}

.order-item-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.order-item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-item-date {
    font-size: 13px;
    color: #67748e;
}

.order-item-total {
    font-size: 15px;
    font-weight: 600;
    color: #344767;
}

/* Order Details Panel */
.order-details-panel {
    flex: 1;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 27px 0 rgba(0,0,0,0.05);
    overflow: hidden;
}

.order-details-content {
    padding: 24px;
    height: 100%;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    text-align: center;
}

.empty-state svg {
    color: #cbd5e0;
    margin-bottom: 16px;
}

.empty-state h3 {
    color: #344767;
    font-size: 24px;
    margin-bottom: 8px;
}

.empty-state p {
    color: #67748e;
    font-size: 16px;
}

/* Order Details */
.order-details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f2f5;
}

.order-details-number {
    font-size: 24px;
    font-weight: 700;
    color: #344767;
    margin-bottom: 8px;
}

.order-details-date {
    color: #67748e;
    font-size: 14px;
}

.order-details-status {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status Colors - Админ стиль */
.status-new { 
    background: linear-gradient(195deg, #FFA726 0%, #FB8C00 100%); 
    color: white; 
}

.status-pending { 
    background: linear-gradient(195deg, #FFA726 0%, #FB8C00 100%); 
    color: white; 
}

.status-confirmed { 
    background: linear-gradient(195deg, #49a3f1 0%, #1A73E8 100%); 
    color: white; 
}

.status-preparing { 
    background: linear-gradient(195deg, #AB47BC 0%, #8E24AA 100%); 
    color: white; 
}

.status-ready { 
    background: linear-gradient(195deg, #26C6DA 0%, #00ACC1 100%); 
    color: white; 
}

.status-delivering { 
    background: linear-gradient(195deg, #26C6DA 0%, #00ACC1 100%); 
    color: white; 
}

.status-delivered { 
    background: linear-gradient(195deg, #66BB6A 0%, #43A047 100%); 
    color: white; 
}

.status-cancelled { 
    background: linear-gradient(195deg, #F44336 0%, #d32f2f 100%); 
    color: white; 
}

/* Order Items */
.order-items {
    margin-bottom: 24px;
}

.order-items h4 {
    font-size: 16px;
    font-weight: 600;
    color: #344767;
    margin-bottom: 16px;
}

.order-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f2f5;
}

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

.item-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #f0f2f5;
    margin-right: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.item-image-placeholder {
    width: 100%;
    height: 100%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-size: 12px;
}

.item-info {
    flex: 1;
}

.item-name {
    font-size: 14px;
    font-weight: 600;
    color: #344767;
    margin-bottom: 4px;
}

.item-quantity {
    font-size: 13px;
    color: #67748e;
}

.item-price {
    font-weight: 600;
    color: #344767;
    font-size: 15px;
}

/* Order Info Grid */
.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.order-info-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
}

.order-info-card h5 {
    font-size: 14px;
    font-weight: 600;
    color: #344767;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

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

.order-info-label {
    color: #67748e;
}

.order-info-value {
    font-weight: 600;
    color: #344767;
}

.editable-field {
    cursor: pointer;
    color: #1A73E8;
    text-decoration: underline;
}

.editable-field:hover {
    color: #0d47a1;
}

/* Order Total */
.order-total-section {
    border-top: 2px solid #f0f2f5;
    padding-top: 16px;
    margin-top: 24px;
}

.order-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
    color: #344767;
}

.order-total-row.final {
    font-size: 20px;
    font-weight: 700;
    color: #43A047;
    margin-top: 12px;
    padding-top: 16px;
    border-top: 2px solid #43A047;
}

/* No Orders */
.no-orders {
    text-align: center;
    padding: 64px 20px;
    background: white;
    border-radius: 16px;
}

.no-orders svg {
    color: #cbd5e0;
    margin-bottom: 16px;
}

.no-orders h3 {
    color: #2d3748;
    font-size: 24px;
    margin-bottom: 8px;
}

.no-orders p {
    color: #718096;
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 1024px) {
    .orders-workspace {
        flex-direction: column;
        gap: 16px;
    }

    .orders-sidebar {
        width: 100%;
        max-height: 300px;
    }

    .sidebar-orders-list {
        max-height: 200px;
    }

    .order-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header h1 {
        font-size: 24px;
    }

    .form-card {
        padding: 32px 24px;
    }

    .account-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .btn-secondary {
        width: 100%;
    }

    .container {
        max-width: 100%;
        padding: 0 10px;
    }

    .order-details-content {
        padding: 16px;
    }

    .account-actions {
        flex-direction: column;
        width: 100%;
    }
}

/* Profile Modal */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.profile-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.profile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid #f0f2f5;
}

.profile-modal-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #344767;
    margin: 0;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #67748e;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal-btn:hover {
    color: #344767;
}

.profile-modal-content form {
    padding: 32px;
}

.profile-modal-content .form-group {
    margin-bottom: 20px;
}

.profile-modal-content .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #344767;
    font-size: 14px;
}

.profile-modal-content .form-group input,
.profile-modal-content .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.profile-modal-content .form-group input:focus,
.profile-modal-content .form-group textarea:focus {
    outline: none;
    border-color: #1A73E8;
}

.profile-modal-content .form-group input:disabled {
    background: #f8f9fa;
    color: #67748e;
    cursor: not-allowed;
}

.profile-modal-content .form-note {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #67748e;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions .btn {
    flex: 1;
    padding: 14px 24px;
}
