/* 주방 디스플레이 전용 스타일 */

.kitchen-body {
    background: #1a1a1a;
    color: #ffffff;
    font-family: 'Noto Sans KR', Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

.kitchen-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.kitchen-header {
    background: linear-gradient(135deg, #FF6B35, #FF8C42);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.kitchen-title h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.kitchen-time {
    font-size: 1.5em;
    font-family: 'KBO Dia Gothic';
    color: rgba(255, 255, 255, 0.9);
    margin-top: 5px;
}

.kitchen-stats {
    display: flex;
    gap: 30px;
}

.kitchen-stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    min-width: 80px;
    transition: all 0.3s;
}

.kitchen-stat.urgent {
    background: rgba(220, 53, 69, 0.8);
    animation: urgentPulse 2s infinite;
}

.stat-value {
    display: block;
    font-size: 2.5em;
    font-weight: bold;
    line-height: 1;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-top: 5px;
    display: block;
}

@keyframes urgentPulse {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.7; }
}

.kitchen-main {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.kitchen-main section {
    background: #2d2d2d;
    border-radius: 15px;
    padding: 20px;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.urgent-orders {
    border-color: #dc3545;
    background: linear-gradient(135deg, #2d1b1b, #2d2d2d);
}

.normal-orders {
    border-color: #FF6B35;
}

.preparing-orders {
    border-color: #28a745;
    background: linear-gradient(135deg, #1b2d1b, #2d2d2d);
}

.kitchen-main h2 {
    margin: 0 0 20px 0;
    font-size: 1.8em;
    color: #FF6B35;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.urgent-orders h2 {
    color: #dc3545;
    animation: urgentBlink 1s infinite;
}

.preparing-orders h2 {
    color: #28a745;
}

@keyframes urgentBlink {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.kitchen-order-card {
    background: #3d3d3d;
    border-radius: 12px;
    padding: 20px;
    border-left: 5px solid #FF6B35;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.kitchen-order-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
}

.kitchen-order-card.urgent {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #4d2d2d, #3d3d3d);
    animation: urgentCardPulse 3s infinite;
}

.kitchen-order-card.preparing {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #2d4d2d, #3d3d3d);
}

@keyframes urgentCardPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(220, 53, 69, 0.7); }
    50% { box-shadow: 0 0 30px rgba(220, 53, 69, 0.7); }
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.order-id {
    font-size: 1.4em;
    font-weight: bold;
    color: #FF6B35;
}

.order-time {
    font-size: 0.9em;
    color: #cccccc;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 15px;
}

.order-time.urgent {
    background: #dc3545;
    color: white;
    animation: urgentTime 1s infinite;
}

@keyframes urgentTime {
    0%, 100% { background: #dc3545; }
    50% { background: #ff1744; }
}

.table-info {
    font-size: 1.2em;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 10px;
}

.customer-name {
    color: #cccccc;
    font-size: 0.95em;
    margin-bottom: 15px;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #4d4d4d;
}

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

.menu-name {
    font-weight: bold;
    color: #ffffff;
}

.menu-quantity {
    background: #FF6B35;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.menu-status-indicator {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6c757d;
    transition: all 0.3s;
}

.status-dot.preparing {
    background: #ffc107;
    animation: preparingBlink 2s infinite;
}

.status-dot.ready {
    background: #28a745;
}

@keyframes preparingBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.kitchen-actions {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.action-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #FF6B35;
    color: #FF6B35;
    padding: 12px 15px;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: #FF6B35;
    color: white;
    transform: scale(1.1);
}

.action-btn:active {
    transform: scale(0.95);
}

/* 전체화면 모드 */
.fullscreen .kitchen-actions {
    bottom: 10px;
    right: 10px;
}

/* 빈 상태 메시지 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 1.2em;
}

.empty-state.urgent {
    color: #dc3545;
}

.empty-state.normal {
    color: #FF6B35;
}

.empty-state.preparing {
    color: #28a745;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .kitchen-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .orders-grid {
        grid-template-columns: 1fr;
    }
    
    .kitchen-stats {
        gap: 15px;
    }
}

/* 큰 화면 최적화 */
@media (min-width: 1400px) {
    .orders-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    
    .kitchen-order-card {
        font-size: 1.1em;
    }
}

/* ==== iPad-optimized layout for Kitchen ==== */

/* iPad(세로/가로) 범위를 넉넉히 커버 */
@media (min-width: 820px) and (max-width: 1366px) {
  .kitchen-title h1 { font-size: 2rem; }
  .kitchen-time { font-size: 1.25rem; }

  /* 카드가 너무 커져서 적게 보이지 않게 3열 기본 */
  .orders-grid { grid-template-columns: repeat(3, minmax(260px, 1fr)); }

  /* 상단 스탯 버튼 터치 영역 확대 */
  .kitchen-stat { min-width: 100px; padding: 16px 18px; }

  /* 하단 고정 액션 버튼 살짝 키우기 */
  .action-btn { font-size: 1rem; padding: 12px 16px; }
}

/* iPad 가로(스테이션에서 주로 가로 사용) */
@media (orientation: landscape) and (min-width: 1024px) and (max-width: 1366px) {
  .orders-grid { grid-template-columns: repeat(4, minmax(240px, 1fr)); }
}

/* 새로운 상태별 섹션 스타일 */
.confirmed-orders {
    border-color: #27ae60;
    background: linear-gradient(135deg, #1b2d1b, #2d2d2d);
}

.in-progress-orders {
    border-color: #3498db;
    background: linear-gradient(135deg, #1b1b2d, #2d2d2d);
}

.served-orders {
    border-color: #2ecc71;
    background: linear-gradient(135deg, #1b2d1b, #2d2d2d);
}

.confirmed-orders h2 {
    color: #27ae60;
}

.in-progress-orders h2 {
    color: #3498db;
}

.served-orders h2 {
    color: #2ecc71;
}

/* 주문 카드 상태별 스타일 */
.kitchen-order-card.confirmed {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, #2d4d2d, #3d3d3d);
}

.kitchen-order-card.in-progress {
    border-left-color: #3498db;
    background: linear-gradient(135deg, #2d2d4d, #3d3d3d);
}

.kitchen-order-card.served {
    border-left-color: #2ecc71;
    background: linear-gradient(135deg, #2d4d2d, #3d3d3d);
    opacity: 0.8;
}

/* 주문 상태 배지 */
.order-status {
    margin: 10px 0;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
    color: white;
}

/* 주문 총액 */
.order-total {
    text-align: right;
    font-weight: bold;
    color: #FF6B35;
    font-size: 1.1em;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #4d4d4d;
}

/* 항목 없음 스타일 */
.no-items {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 10px;
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #2d2d2d;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #FF6B35, #FF8C42);
    border-radius: 15px 15px 0 0;
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5em;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
    color: white;
}

.modal-order-details h4,
.status-change-info h4 {
    color: #FF6B35;
    margin: 0 0 15px 0;
    font-size: 1.2em;
}

.modal-order-details p {
    margin: 8px 0;
    font-size: 1em;
}

.order-items {
    margin-top: 15px;
}

.order-items h5 {
    color: #cccccc;
    margin: 10px 0 8px 0;
    font-size: 1em;
}

.order-items ul {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #3d3d3d;
    border-radius: 8px;
    padding: 12px;
}

.order-items li {
    padding: 5px 0;
    color: #ffffff;
    border-bottom: 1px solid #4d4d4d;
}

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

.status-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.current-status,
.next-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    color: white;
    font-size: 1em;
}

.arrow {
    font-size: 1.5em;
    color: #FF6B35;
    font-weight: bold;
}

.action-question {
    text-align: center;
    font-size: 1.1em;
    color: #ffffff;
    margin: 20px 0;
    font-weight: 500;
}

.modal-footer {
    padding: 20px 25px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    background: #1a1a1a;
    border-radius: 0 0 15px 15px;
}

.modal-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
}

.modal-btn.confirm {
    background: #27ae60;
    color: white;
}

.modal-btn.confirm:hover {
    background: #2ecc71;
    transform: translateY(-2px);
}

.modal-btn.confirm:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.modal-btn.cancel {
    background: #6c757d;
    color: white;
}

.modal-btn.cancel:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* 빈 상태 추가 스타일 */
.empty-state.confirmed {
    color: #27ae60;
}

.empty-state.in-progress {
    color: #3498db;
}

.empty-state.served {
    color: #2ecc71;
}

.empty-state.error {
    color: #dc3545;
}

/* 모바일에서 모달 최적화 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px 20px;
    }
    
    .status-flow {
        flex-direction: column;
        gap: 10px;
    }
    
    .arrow {
        transform: rotate(90deg);
    }
}
