/* ========================================
   PWA 전용 스타일 - 버건디 색상
   ======================================== */

/* PWA 모드일 때 버건디 배경 적용 */
body.pwa-mode {
    background-color: #8B0000 !important;
}

/* PWA 스플래시 스크린 스타일 */
@media all and (display-mode: standalone) {
    body {
        background-color: #8B0000;
    }
    
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, #8B0000 0%, #A52A2A 100%);
        z-index: -1;
    }
}

/* iOS PWA 상태바 스타일 */
@supports (-webkit-touch-callout: none) {
    body.pwa-mode {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* PWA 로딩 애니메이션 */
.pwa-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #8B0000 0%, #A52A2A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.pwa-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.pwa-loading-icon {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* PWA 설치 배너 */
.pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #2E7D32 0%, #1B5E20 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        bottom: -100px;
        opacity: 0;
    }
    to {
        bottom: 20px;
        opacity: 1;
    }
}

.pwa-install-banner button {
    background: white;
    color: #2E7D32;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-install-banner button:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* iOS 전용 설치 안내 */
.ios-install-message {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2E7D32 0%, #1B5E20 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: slideUp 0.5s ease-out;
}

.ios-install-message p {
    margin: 5px 0;
    font-size: 14px;
}

.ios-install-message .icon {
    font-size: 24px;
    margin: 0 5px;
}

/* 온라인/오프라인 상태 표시 */
.online-status {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.95);
    color: #2E7D32;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
}

.online-status.status-online {
    color: #2E7D32;
    display: block;
}

.online-status.status-offline {
    color: #d32f2f;
    display: block;
}

.online-status::before {
    content: '●';
    margin-right: 5px;
}

/* PWA 앱 모드 감지 후 적용 */
@media (display-mode: standalone), 
       (display-mode: fullscreen),
       (display-mode: minimal-ui) {
    
    /* 상단바 색상 */
    body {
        background-color: #f8f9fa;
    }
    
    /* 헤더 고정 */
    header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    /* 하단 여백 추가 (iOS safe area) */
    footer {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* 다크모드 지원 (선택사항) */
@media (prefers-color-scheme: dark) {
    @media (display-mode: standalone) {
        body {
            background-color: #1a1a1a;
            color: #f0f0f0;
        }
        
        body::before {
            background: linear-gradient(135deg, #1B5E20 0%, #0D3818 100%);
        }
    }
}
