/* deployed Mon Jan  5 11:48:56 UTC 2026 */

/* Long Press Ripple Effect */
.long-press-ripple {
    position: fixed;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.4);
    border: 2px solid rgba(102, 126, 234, 0.8);
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 9999;
    animation: ripple-expand 0.6s ease-out;
}

@keyframes ripple-expand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* Tap Ripple Effect - lighter and faster than long-press */
.tap-ripple {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 9999;
    animation: tap-ripple-expand 0.4s ease-out;
}

@keyframes tap-ripple-expand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* Zoom Level Indicator */
.zoom-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 32px;
    font-weight: bold;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    border-radius: 12px;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.zoom-indicator.visible {
    opacity: 1;
}

/* ========================================
   Mobile Responsive Breakpoints
   ======================================== */

/* Tablet & Mobile (≤768px) */
@media (max-width: 768px) {
    /* 모바일: 터치 타겟 최소 44x44px (Apple HIG 권장) */
    .color-bar-cell {
        width: 44px;
        height: 44px;
        border-radius: 8px;
    }

    /* 확장 모드에서도 동일한 크기 유지 */
    #color-palette-bar.expanded .color-bar-cell {
        width: 44px;
        height: 44px;
        border-radius: 8px;
    }

    /* 모멘텀 스크롤링 최적화 */
    #color-grid-wrapper {
        -webkit-overflow-scrolling: touch; /* iOS Safari 레거시 지원 */
        scroll-behavior: smooth;
    }

    /* 확장 모드에서도 부드러운 스크롤 */
    #color-palette-bar.expanded #color-grid-wrapper {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* 줌 인디케이터 크기 조정 */
    .zoom-indicator {
        font-size: 28px;
        padding: 10px 20px;
        border-radius: 10px;
    }

    /* 리플 효과 약간 축소 */
    .long-press-ripple {
        width: 28px;
        height: 28px;
    }

    .tap-ripple {
        width: 18px;
        height: 18px;
    }
}

/* Small Mobile (≤600px) */
@media (max-width: 600px) {
    /* 줌 인디케이터 추가 축소 */
    .zoom-indicator {
        font-size: 24px;
        padding: 8px 16px;
        border-radius: 8px;
    }

    /* 리플 효과 추가 축소 */
    .long-press-ripple {
        width: 24px;
        height: 24px;
    }

    .tap-ripple {
        width: 16px;
        height: 16px;
    }
}

/* Extra Small Mobile (≤480px) */
@media (max-width: 480px) {
    /* Color Palette 셀 크기 유지 (터치 타겟 최소 기준) */
    .color-bar-cell {
        width: 44px;
        height: 44px;
    }

    #color-palette-bar.expanded .color-bar-cell {
        width: 44px;
        height: 44px;
    }

    /* 줌 인디케이터 최소 크기 */
    .zoom-indicator {
        font-size: 20px;
        padding: 6px 12px;
    }
}

/* Landscape Orientation (터치 디바이스) */
@media (max-width: 900px) and (orientation: landscape) {
    /* 가로 모드에서 줌 인디케이터 위치 조정 */
    .zoom-indicator {
        top: 40%;
        padding: 8px 16px;
        font-size: 24px;
    }

    /* 리플 효과 크기 조정 */
    .long-press-ripple {
        width: 24px;
        height: 24px;
    }

    .tap-ripple {
        width: 16px;
        height: 16px;
    }
}

/* CAPTCHA Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 0;
    width: 90%;
    max-width: 450px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
    position: relative;
}

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

.modal-content h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.captcha-modal {
    padding: 30px;
}

.captcha-reason {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.captcha-challenge {
    margin-bottom: 20px;
}

.captcha-question {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    border-left: 4px solid #667eea;
}

.captcha-challenge input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.captcha-challenge input[type="text"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.captcha-error {
    background: #fee;
    color: #c33;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    border-left: 4px solid #c33;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-buttons button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

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

.btn-secondary:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .modal-content {
        margin: 5% auto;
        width: 95%;
        max-width: none;
    }

    .captcha-modal {
        padding: 20px;
    }

    .modal-content h2 {
        font-size: 20px;
    }

    .captcha-question {
        font-size: 14px;
        padding: 12px;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .modal-buttons button {
        width: 100%;
    }
}
