/* 모바일 전용 최적화 CSS - 한 화면에 더 많은 정보 표시 */

/* 관리자 페이지 버튼 클릭 보장 */
.admin-login-page *,
.admin-dashboard-page * {
    pointer-events: auto !important;
}

.admin-login-page button,
.admin-dashboard-page button,
.admin-login-page input,
.admin-dashboard-page input,
.admin-login-page a,
.admin-dashboard-page a {
    pointer-events: auto !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(201, 162, 39, 0.3) !important;
    touch-action: manipulation !important;
}

/* 터치 영역 최적화 - 관리자 페이지 제외 */
@media (max-width: 768px) {
    /* 관리자 페이지는 모든 최적화에서 제외 */
    body:not(.admin-login-page):not(.admin-dashboard-page) {
        font-size: 14px;
        line-height: 1.5;
    }
    
    /* 섹션 여백 대폭 축소 - 한 화면에 더 많은 콘텐츠 */
    body:not(.admin-login-page):not(.admin-dashboard-page) .section {
        padding: 2rem 1rem !important;
    }
    
    /* 타이틀 크기 축소 */
    body:not(.admin-login-page):not(.admin-dashboard-page) .section-title {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
        line-height: 1.2;
    }
    
    body:not(.admin-login-page):not(.admin-dashboard-page) .section-subtitle {
        font-size: 0.85rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* 텍스트 가독성 - 콤팩트하게 */
    body:not(.admin-login-page):not(.admin-dashboard-page) p {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.8rem !important;
    }
    
    body:not(.admin-login-page):not(.admin-dashboard-page) li {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }
    
    /* 카드 간격 축소 */
    body:not(.admin-login-page):not(.admin-dashboard-page) .card, 
    body:not(.admin-login-page):not(.admin-dashboard-page) .branch-card, 
    body:not(.admin-login-page):not(.admin-dashboard-page) .position-card, 
    body:not(.admin-login-page):not(.admin-dashboard-page) .notice-card {
        margin-bottom: 1rem !important;
        padding: 1rem !important;
    }
    
    /* 버튼 크기 축소 */
    body:not(.admin-login-page):not(.admin-dashboard-page) .btn {
        padding: 0.6rem 1.2rem !important;
        font-size: 0.9rem !important;
        min-height: 44px;
    }
    
    /* 모든 클릭 가능 요소 터치 영역 최소화하되 충분히 */
    body:not(.admin-login-page):not(.admin-dashboard-page) a:not(.btn), 
    body:not(.admin-login-page):not(.admin-dashboard-page) button:not(.btn) {
        min-height: 40px;
        padding: 0.5rem 0.8rem;
    }
    
    /* 입력 필드 크기 조정 */
    body:not(.admin-login-page):not(.admin-dashboard-page) input, 
    body:not(.admin-login-page):not(.admin-dashboard-page) textarea, 
    body:not(.admin-login-page):not(.admin-dashboard-page) select {
        font-size: 16px !important; /* iOS 자동 줌 방지 */
        padding: 0.7rem !important;
    }
    
    /* 이미지 터치 시 하이라이트 제거 */
    body:not(.admin-login-page):not(.admin-dashboard-page) img {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }
    
    /* 링크 터치 효과 */
    body:not(.admin-login-page):not(.admin-dashboard-page) a {
        -webkit-tap-highlight-color: rgba(201, 162, 39, 0.3);
    }
    
    /* 그리드 1단 레이아웃 - 간격 축소 */
    body:not(.admin-login-page):not(.admin-dashboard-page) .card-grid, 
    body:not(.admin-login-page):not(.admin-dashboard-page) .branch-grid, 
    body:not(.admin-login-page):not(.admin-dashboard-page) .positions-grid, 
    body:not(.admin-login-page):not(.admin-dashboard-page) .process-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* 폼 레이아웃 - 간격 축소 */
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 0.8rem !important;
    }
    
    .form-group {
        margin-bottom: 0.8rem !important;
    }
    
    /* 네비게이션 개선 - 콤팩트하게 */
    .navbar {
        padding: 0.8rem 1rem !important;
    }
    
    .nav-brand {
        font-size: 1.2rem !important;
    }
    
    .nav-menu {
        padding: 1rem 0 !important;
    }
    
    .nav-menu li {
        margin: 0 !important;
        padding: 0.8rem 1rem !important;
        border-bottom: 1px solid rgba(201, 162, 39, 0.1);
    }
    
    .nav-menu a {
        display: block;
        padding: 0 !important;
        font-size: 1rem !important;
    }
    
    /* Footer 모바일 최적화 - 콤팩트하게 */
    .footer {
        padding: 2rem 1rem 1rem !important;
    }
    
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        text-align: center;
    }
    
    .footer-brand h3 {
        font-size: 1.2rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .footer-brand p {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }
    
    .footer-section {
        padding: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .footer-section h3, .footer-section h4 {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .footer-section p,
    .footer-section a,
    .footer-section li {
        font-size: 0.8rem !important;
        line-height: 1.6 !important;
        margin-bottom: 0.3rem !important;
    }
    
    .footer-social {
        justify-content: center;
        gap: 1.5rem;
        margin-top: 0.8rem !important;
    }
    
    .footer-social a {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.5rem !important;
        min-width: 50px;
        min-height: 50px;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: 2px solid var(--color-gold) !important;
        background: rgba(201, 162, 39, 0.1) !important;
        border-radius: 50%;
        transition: all 0.3s ease;
    }
    
    .footer-social a:active {
        background: var(--color-gold) !important;
        transform: scale(0.95);
    }
    
    .footer-bottom {
        padding: 1rem 0 !important;
        margin-top: 1rem !important;
    }
    
    .footer-bottom p {
        font-size: 0.75rem !important;
    }
    
    /* Hero 섹션 모바일 - 콤팩트하게 */
    .hero {
        min-height: 70vh !important;
        padding: 6rem 1rem 3rem !important;
    }
    
    .hero-title {
        font-size: 1.8rem !important;
        margin-bottom: 1rem !important;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.9rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* 갤러리 최적화 - 작은 크기 */
    .gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 0.8rem !important;
    }
    
    .gallery-item {
        height: 250px !important;
    }
    
    /* 타임라인 모바일 - 콤팩트 */
    .timeline-item {
        padding-left: 2rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .timeline-content {
        padding: 1rem !important;
    }
    
    .timeline-content h3 {
        font-size: 1.1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .timeline-content p {
        font-size: 0.85rem !important;
    }
    
    .timeline-marker {
        left: 0;
        width: 30px !important;
        height: 30px !important;
    }
    
    /* 비교표 모바일 */
    .comparison-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .comparison-row {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .comparison-col {
        width: 100% !important;
        border: none !important;
        border-bottom: 1px solid rgba(201, 162, 39, 0.1);
        padding: 0.8rem !important;
    }
    
    /* 가맹 프로세스 모바일 */
    .process-timeline {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .process-step, .process-step-mini {
        width: 100% !important;
        padding: 1rem !important;
    }
    
    /* Q&A 아코디언 - 콤팩트 */
    .qna-item {
        margin-bottom: 0.8rem !important;
        padding: 1rem !important;
    }
    
    .qna-question {
        padding: 1rem !important;
        font-size: 0.95rem !important;
    }
    
    .qna-answer {
        padding: 0 1rem 1rem !important;
        font-size: 0.85rem !important;
    }
    
    /* 공지사항 카드 - 콤팩트 */
    .notice-card {
        padding: 1rem !important;
    }
    
    .notice-card h3 {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .notice-card p {
        font-size: 0.85rem !important;
    }
    
    .notice-meta {
        font-size: 0.75rem !important;
        margin-top: 0.5rem !important;
    }
    
    /* 지점 카드 - 콤팩트 */
    .branch-card {
        padding: 1rem !important;
    }
    
    .branch-card h3 {
        font-size: 1.1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .branch-card p {
        font-size: 0.85rem !important;
        margin-bottom: 0.3rem !important;
    }
    
    /* 헤더 간격 축소 */
    .page-header {
        padding: 6rem 1rem 2rem !important;
        min-height: auto !important;
    }
    
    .page-header h1 {
        font-size: 1.8rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .page-header p {
        font-size: 0.9rem !important;
    }
    
    /* 스크롤 개선 */
    html {
        scroll-padding-top: 70px;
    }
    
    /* 이미지 로딩 최적화 */
    img {
        loading: lazy;
    }
    
    /* 테이블 모바일 최적화 */
    table {
        font-size: 0.85rem !important;
    }
    
    table th, table td {
        padding: 0.5rem !important;
    }
    
    /* 배지 크기 축소 */
    .badge, .notice-badge, .qna-badge {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.5rem !important;
    }
    
    /* 아이콘 크기 축소 */
    .icon, i {
        font-size: 1rem !important;
    }
    
    /* 모달/팝업 모바일 */
    .modal-content {
        padding: 1.5rem 1rem !important;
        margin: 1rem !important;
    }
}

/* 작은 모바일 (iPhone SE 등) - 더욱 콤팩트 */
@media (max-width: 375px) {
    body {
        font-size: 13px;
    }
    
    .section {
        padding: 1.5rem 0.8rem !important;
    }
    
    .section-title {
        font-size: 1.3rem !important;
    }
    
    .hero {
        padding: 5rem 0.8rem 2rem !important;
    }
    
    .hero-title {
        font-size: 1.6rem !important;
    }
    
    .btn {
        font-size: 0.85rem !important;
        padding: 0.5rem 1rem !important;
    }
    
    .footer-section p,
    .footer-section a {
        font-size: 0.75rem !important;
    }
    
    .gallery-item {
        height: 200px !important;
    }
}

/* 가로 모드 최적화 */
@media (max-width: 968px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 4rem 1.5rem 2rem !important;
    }
    
    .section {
        padding: 1.5rem 1rem !important;
    }
    
    .navbar {
        padding: 0.8rem 1rem !important;
    }
}

/* iOS Safari 특정 수정 */
@supports (-webkit-touch-callout: none) {
    /* iOS 주소창 숨김 대응 */
    .hero {
        min-height: -webkit-fill-available;
    }
    
    /* iOS 입력 필드 그림자 제거 */
    input, textarea, select {
        -webkit-appearance: none;
        border-radius: 4px;
    }
}

/* 접근성: 큰 텍스트 모드 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 고대비 모드 */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    a {
        text-decoration: underline;
    }
}
