/**
 * index.php 모바일 하단 날씨·검색 도크 + 프로필 모달 (≤1024px)
 * 기사 등 공통 페이지에서 로드
 */

.mobile-bottom-weather-search-bar {
    display: none !important;
}

.mobile-profile-modal {
    display: none !important;
}

@media (max-width: 1024px) {
    .mobile-bottom-weather-search-bar {
        display: flex !important;
        flex-direction: column !important;
        visibility: visible !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: transparent !important;
        border-top: none !important;
        padding: 0 !important;
        z-index: 10000;
        box-shadow: none !important;
    }

    .mobile-bottom-bar-dock {
        position: relative;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        flex-shrink: 0;
    }

    .mobile-bottom-search-sheet {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.38s cubic-bezier(0.32, 0.72, 0, 1), padding 0.38s cubic-bezier(0.32, 0.72, 0, 1);
        padding: 0 14px;
        border-bottom: none !important;
        background: transparent !important;
        box-shadow: none !important;
        flex-shrink: 0;
    }

    .mobile-bottom-search-sheet.is-open {
        max-height: 96px;
        padding: 10px 14px 12px;
    }

    .mobile-bottom-search-sheet-inner {
        display: flex;
        align-items: center;
        gap: 10px;
        max-width: 100%;
        padding: 0;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        transform: translateY(14px);
        transition: transform 0.4s cubic-bezier(0.22, 1.12, 0.36, 1);
    }

    .mobile-bottom-search-sheet.is-open .mobile-bottom-search-sheet-inner {
        transform: translateY(0);
    }

    .mobile-search-form.mobile-search-form--sheet {
        flex: 1;
        min-width: 0;
        height: 46px;
        padding: 0 12px 0 10px !important;
        background: #ffffff !important;
        border: 1px solid rgba(15, 23, 42, 0.1) !important;
        border-radius: 14px !important;
        box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06) !important;
    }

    .mobile-bottom-search-sheet.is-open .mobile-search-form.mobile-search-form--sheet {
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
    }

    .mobile-search-form--sheet .mobile-search-slot-icon {
        color: #1e40af;
        font-size: 1rem;
        opacity: 0.95;
    }

    .mobile-search-form--sheet .mobile-search-input {
        font-size: 1rem;
        font-weight: 500;
        letter-spacing: -0.02em;
        color: #0f172a;
    }

    .mobile-search-form--sheet .mobile-search-input::placeholder {
        color: #94a3b8;
        font-weight: 400;
    }

    .mobile-search-sheet-close {
        width: 44px;
        height: 44px;
        min-width: 44px;
        border-radius: 0;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #64748b;
        cursor: pointer;
        flex-shrink: 0;
        padding: 0;
        font-size: 1.15rem;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.2s ease, transform 0.15s ease;
    }

    .mobile-bottom-search-sheet.is-open .mobile-search-sheet-close {
        box-shadow: none !important;
    }

    .mobile-search-sheet-close:active {
        color: #0f172a;
        transform: scale(0.92);
    }

    .mobile-bottom-search-toggle {
        width: 40px;
        height: 40px;
        min-width: 40px;
        padding: 0;
        border: none;
        border-radius: 8px;
        background: #e2e8f0;
        color: #475569;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
        font-size: 0.95rem;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-bottom-search-toggle:active {
        background: #cbd5e1;
    }

    .mobile-bottom-search-toggle.is-open {
        background: #1e293b;
        color: #ffffff;
    }

    .mobile-bottom-scroll-wrap {
        display: flex;
        overflow-x: hidden;
        overflow-y: hidden;
        flex-shrink: 0;
    }

    .mobile-bottom-scroll-wrap::-webkit-scrollbar {
        display: none;
    }

    .mobile-bottom-slide {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        height: 48px;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 16px 0;
        box-sizing: content-box;
    }

    .mobile-bottom-slide-weather {
        justify-content: space-between;
    }

    .mobile-weather-left {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0;
    }

    .mobile-login-right {
        display: flex;
        align-items: center;
        gap: 8px 10px;
        flex-shrink: 0;
    }

    .mobile-bottom-login-btn {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 5px 10px;
        background: #03c75a;
        color: #fff;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        text-decoration: none;
    }

    .mobile-bottom-profile-btn {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 10px;
        background: #f1f5f9;
        border-radius: 20px;
        text-decoration: none;
        color: #334155;
    }

    .mobile-bottom-avatar {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        object-fit: cover;
    }

    .mobile-bottom-name {
        font-size: 11px;
        font-weight: 500;
        max-width: 45px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-search-form {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 8px;
        height: 45px;
        padding: 0 12px;
        background: #f1f5f9;
        border-radius: 8px;
    }

    .mobile-search-slot-icon {
        color: #94a3b8;
        font-size: 0.9rem;
    }

    .mobile-search-input {
        flex: 1;
        min-width: 0;
        border: none;
        background: transparent;
        font-size: 0.9rem;
        outline: none;
    }

    .mobile-weather-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(59, 130, 246, 0.1);
        color: #3b82f6;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        flex-shrink: 0;
    }

    .mobile-weather-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-weather-temp {
        font-size: 1rem;
        font-weight: 700;
        color: #111827;
        line-height: 1.2;
    }

    .mobile-weather-desc {
        font-size: 0.75rem;
        color: #6b7280;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-weather-location {
        font-size: 0.75rem;
        font-weight: 600;
        color: #6b7280;
        white-space: nowrap;
        flex-shrink: 0;
        cursor: pointer;
        transition: color 0.2s;
        padding: 4px 8px;
        border-radius: 4px;
    }

    .mobile-weather-location:hover {
        color: #1e40af;
        background: rgba(59, 130, 246, 0.1);
    }

    .mobile-weather-location:active {
        background: rgba(59, 130, 246, 0.2);
    }

    .mobile-profile-modal {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 10100;
        align-items: flex-end;
        justify-content: center;
    }

    .mobile-profile-modal.visible {
        display: flex !important;
    }

    .mobile-profile-modal-content {
        position: relative;
        width: 100%;
        max-width: 480px;
        background: #fff;
        border-radius: 16px 16px 0 0;
        padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
        transform: translateY(100%);
        transition: transform 0.3s ease;
        max-height: 75vh;
        overflow-y: auto;
    }

    .mobile-profile-modal.visible .mobile-profile-modal-content {
        transform: translateY(0);
    }

    .mobile-profile-modal-header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid #e2e8f0;
        margin-bottom: 12px;
    }

    .mobile-profile-modal-close {
        margin-left: auto;
        width: 36px;
        height: 36px;
        border: none;
        background: #f1f5f9;
        border-radius: 8px;
        color: #64748b;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .mobile-profile-modal-close:active {
        background: #e2e8f0;
    }

    .mobile-profile-modal-avatar {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        object-fit: cover;
    }

    .mobile-profile-modal-name {
        font-size: 16px;
        font-weight: 600;
        color: #111827;
    }

    .mobile-profile-modal-links {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }

    .mobile-profile-modal-links a {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 14px;
        border-radius: 10px;
        color: #334155;
        text-decoration: none;
        font-size: 15px;
        background: #f8fafc;
    }

    .mobile-profile-modal-links a:active {
        background: #e2e8f0;
    }

    .mobile-profile-modal-agent {
        background: #f1f5f9;
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 12px;
        font-size: 13px;
    }

    .mobile-profile-modal-agent-title {
        font-weight: 600;
        color: #334155;
        margin-bottom: 8px;
    }

    .mobile-profile-modal-agent-row {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        padding: 4px 0;
    }

    .mobile-profile-modal-agent-row span:first-child {
        color: #64748b;
    }

    .mobile-profile-modal-agent-row span:last-child {
        font-weight: 500;
    }

    .mobile-profile-modal-footer {
        display: flex;
        gap: 10px;
        justify-content: flex-end;
    }

    .mobile-profile-modal-footer--stacked {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-profile-modal-btn {
        padding: 10px 18px;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
        color: #334155;
        background: #e2e8f0;
    }

    .mobile-profile-modal-btn--block {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        justify-content: center;
    }

    .mobile-profile-modal-btn:active {
        background: #cbd5e1;
    }

    .mobile-profile-modal-btn.logout {
        color: #dc2626;
        background: #fef2f2;
    }

    .mobile-profile-modal-btn.logout:active {
        background: #fee2e2;
    }

    .mobile-profile-modal-admin-stats {
        font-size: 12px;
        background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 10px 12px;
    }

    .mobile-profile-modal-today-stats {
        margin-bottom: 12px;
    }

    .mobile-profile-modal-footer .mobile-profile-modal-admin-extra-stats {
        margin-top: 10px;
    }

    .mobile-profile-modal-admin-stats-title {
        font-weight: 700;
        color: #475569;
        margin-bottom: 8px;
        font-size: 11px;
        letter-spacing: 0.04em;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .mobile-profile-modal-admin-stats-title i {
        color: #64748b;
    }

    .mobile-profile-modal-admin-stats-row {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        padding: 4px 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .mobile-profile-modal-admin-stats-row:last-child {
        border-bottom: none;
    }

    .mobile-profile-modal-admin-stats-row span:first-child {
        color: #64748b;
    }

    .mobile-profile-modal-admin-stats-row strong {
        color: #0f172a;
        font-weight: 600;
    }
}
