/* POSiTV Display CSS - Vollständige Version mit Modal-Styles */

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #4CAF50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #2196F3;
    --processing: #ffc107;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.positv-header {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

/* Logo Button */
.logo-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    width: 80px;
    height: 80px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 10px;
    flex-shrink: 0;
}

.logo-btn:hover {
    background: #f5f5f5;
    border-color: #2196F3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.1);
}

.logo-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo-btn img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Stats Container */
.stats-container {
    display: flex;
    gap: 15px;
    flex: 1;
    justify-content: flex-start;
}

/* Stat Items */
.stat-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.stat-item:hover {
    border-color: #2196F3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.1);
}

.stat-item.active {
    background: #2196F3;
    border-color: #2196F3;
    color: white;
}

.stat-item.active .stat-value,
.stat-item.active .stat-label {
    color: white;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #2196F3;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

/* Logout Button */
.logout-btn {
    background: #f44336;
    border: none;
    border-radius: 10px;
    width: 80px;
    height: 80px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: white;
    font-size: 28px;
    flex-shrink: 0;
    margin-left: auto;
}

.logout-btn:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.2);
}

/* Orders Grid */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Order Card */
.order-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 5px solid var(--warning);
    position: relative;
}

.order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.order-card.new {
    border-left-color: var(--warning);
    animation: pulse 2s infinite;
}

.order-card.confirmed {
    border-left-color: var(--info);
}

.order-card.processing {
    border-left-color: #9C27B0;
}

.order-card.ready {
    border-left-color: var(--success);
}

.order-header {
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.order-id {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.order-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.order-date {
    font-size: 0.8rem;
    color: #999;
}

.order-time {
    color: #666;
    font-size: 0.9rem;
    display: block;
}

.order-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
    display: inline-block;
}

.order-body {
    padding: 20px;
}

.order-summary {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.order-type, .order-items-count {
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #666;
}

.order-item-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.order-item-preview i {
    color: var(--primary);
}

.order-comment-preview {
    background: #fff3cd;
    color: #856404;
    padding: 8px 10px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    max-height: 40px;
    overflow: hidden;
}

.order-customer {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9rem;
    margin-top: 10px;
}

.order-footer {
    padding: 15px 20px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.order-total {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
}

.order-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    color: white;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
}

.btn-process {
    background: linear-gradient(135deg, var(--processing) 0%, #e0a800 100%);
    color: #000 !important;
}

.btn-complete {
    background: linear-gradient(135deg, var(--success) 0%, #45a049 100%);
}

.btn-print {
    background: linear-gradient(135deg, var(--info) 0%, #1976D2 100%);
}

.btn-action:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
}

.btn-action i {
    font-size: 1rem;
}

/* rote "X"-Button */
.btn-action.btn-deliver {
    background-color: #f44336;
    color: white;
}

.btn-action.btn-deliver:hover {
    background-color: #d32f2f;
}

/* Loading */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 20px;
    animation: spin 2s linear infinite;
}

/* Modal - Vollständige Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-content {
    padding: 30px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Modal Content */
.order-details {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.detail-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #eaeaea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.detail-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.detail-section h3 i {
    color: var(--primary);
    width: 24px;
    text-align: center;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item .label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item .value {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    display: inline-block;
    letter-spacing: 0.5px;
}

/* Order Items Table */
.order-items-table {
    width: 100%;
    margin: 10px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.items-header {
    display: flex;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.item-name-header {
    flex: 3;
    min-width: 250px;
}

.item-qty-header,
.item-price-header,
.item-total-header {
    flex: 1;
    text-align: center;
    min-width: 80px;
}

.order-item-row {
    display: flex;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    align-items: flex-start;
    transition: background-color 0.2s;
}

.order-item-row:hover {
    background-color: #f9f9f9;
}

.order-item-row:last-child {
    border-bottom: none;
}

.item-name-cell {
    flex: 3;
    min-width: 250px;
    padding-right: 15px;
}

.item-name-cell strong {
    display: block;
    font-size: 15px;
    color: #333;
    margin-bottom: 8px;
}

.item-qty-cell,
.item-price-cell,
.item-total-cell {
    flex: 1;
    text-align: center;
    min-width: 80px;
    padding: 5px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-total-cell {
    font-weight: 600;
    color: var(--primary);
}

.item-options {
    margin-top: 8px;
    padding-left: 15px;
    border-left: 2px solid #e0e0e0;
}

.item-option {
    margin: 6px 0;
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.option-name {
    font-weight: 500;
    color: #666;
    min-width: 80px;
    flex-shrink: 0;
}

.option-values {
    flex: 1;
}

.option-value-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.option-value {
    color: #333;
    flex: 1;
}

.option-price {
    color: var(--success);
    font-weight: 500;
    font-size: 12px;
    background: rgba(76, 175, 80, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.item-comment {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff8e1;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.item-comment i {
    color: #ff9800;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Customer Note */
.customer-note {
    background: #e8f4fd;
    border-radius: 8px;
    padding: 15px;
    color: #333;
    line-height: 1.5;
    font-size: 0.95rem;
    border-left: 4px solid var(--info);
}

/* Payment Summary */
.payment-summary {
    background: #f8f9fa;
    padding: 18px 20px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #eaeaea;
}

.payment-method,
.payment-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.payment-method {
    border-bottom: 1px dashed #ddd;
    margin-bottom: 10px;
}

.payment-method .label,
.payment-total .label {
    color: #666;
    font-weight: 500;
    font-size: 0.95rem;
}

.payment-method .value {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.payment-total .label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.total-amount {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.btn-process-large,
.btn-complete-large,
.btn-print-large,
.btn-close-large,
.btn-deliver-large {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-process-large {
    background: linear-gradient(135deg, var(--processing) 0%, #e0a800 100%);
    color: #000;
    border: 2px solid #ffc107;
}

.btn-complete-large {
    background: linear-gradient(135deg, var(--success) 0%, #45a049 100%);
    color: white;
}

.btn-print-large {
    background: linear-gradient(135deg, var(--info) 0%, #1976D2 100%);
    color: white;
}

.btn-close-large {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-deliver-large {
    background-color: #f44336;
    color: white;
    border: none;
}

.btn-process-large:hover {
    background: linear-gradient(135deg, #e0a800 0%, #c69500 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.3);
}

.btn-complete-large:hover,
.btn-print-large:hover,
.btn-close-large:hover,
.btn-deliver-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn-deliver-large:hover {
    background-color: #d32f2f;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    display: none;
    z-index: 1001;
    animation: slideIn 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification.show {
    display: block;
}

.notification.success {
    background: linear-gradient(135deg, var(--success) 0%, #45a049 100%);
}

.notification.error {
    background: linear-gradient(135deg, var(--danger) 0%, #d32f2f 100%);
}

.notification.info {
    background: linear-gradient(135deg, var(--info) 0%, #1976D2 100%);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 20px;
}

.action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    background: linear-gradient(135deg, var(--info) 0%, #1976D2 100%);
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.error-state {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
}

.error-message {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 5px;
    margin: 15px 0;
    font-size: 0.9rem;
}

/* Animations */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 152, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .header-controls {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .stats-container {
        order: 2;
        width: 100%;
        justify-content: center;
    }
    
    .logout-btn {
        order: 3;
    }
}

@media (max-width: 768px) {
    .positv-header {
        padding: 10px;
    }
    
    .logo-btn,
    .stat-item,
    .logout-btn {
        width: 70px;
        height: 70px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .logout-btn {
        font-size: 24px;
    }
    
    .orders-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        padding: 15px;
        gap: 15px;
    }
    
    /* Modal Responsive */
    .items-header,
    .order-item-row {
        flex-wrap: wrap;
    }
    
    .item-name-header,
    .item-name-cell {
        flex: 100%;
        margin-bottom: 12px;
    }
    
    .item-qty-header,
    .item-price-header,
    .item-total-header,
    .item-qty-cell,
    .item-price-cell,
    .item-total-cell {
        flex: 1;
        min-width: auto;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .detail-section {
        padding: 15px;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-process-large,
    .btn-complete-large,
    .btn-print-large,
    .btn-close-large,
    .btn-deliver-large {
        width: 100%;
        min-width: auto;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .stats-container {
        gap: 8px;
    }
    
    .logo-btn,
    .stat-item,
    .logout-btn {
        width: 60px;
        height: 60px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .logout-btn {
        font-size: 20px;
    }
    
    .orders-grid {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 10px;
    }
    
    .order-card {
        padding: 15px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
}