/* Desktop Layout — Test Hole Tagger
   Only applies at 1024px+.
   Mobile layout is COMPLETELY UNTOUCHED. */

@media (min-width: 1024px) {

    /* ═══════ APP SHELL ═══════ */
    #app { flex-direction: row; }
    body { --safe-top: 0px; --safe-bottom: 0px; }

    /* ═══════ LEFT NAV SIDEBAR ═══════ */
    .app-nav {
        width: 200px;
        flex-shrink: 0;
        flex-direction: column;
        align-items: stretch;
        border-top: none;
        border-right: 1px solid rgba(255,255,255,0.06);
        padding: 0;
        order: -1;
        overflow-y: auto;
        background: var(--bg2);
    }
    .app-nav .nav-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 18px 16px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        margin-bottom: 8px;
    }
    .nav-brand-icon { width: 28px; height: 28px; border-radius: 7px; }
    .nav-brand-text { font-size: 14px; font-weight: 800; color: var(--accent); }

    .app-nav .nav-item {
        flex: unset;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        padding: 10px 16px;
        margin: 1px 8px;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        transition: background 0.15s, color 0.15s;
    }
    .app-nav .nav-item:hover { background: var(--bg3); color: var(--text); }
    .app-nav .nav-item.active { background: rgba(0,212,170,0.1); color: var(--accent); }
    .app-nav .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

    /* ═══════ SCREEN CONTAINER ═══════ */
    .screen-container { flex: 1; min-width: 0; }

    /* ═══════ SPLIT PANE LAYOUT ═══════ */
    .desk-split {
        display: flex;
        flex: 1;
        min-height: 0;
        height: 100%;
    }
    .desk-main {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-width: 0;
        border-right: 1px solid rgba(255,255,255,0.06);
        max-width: 50%;
    }
    .desk-main-narrow {
        max-width: 380px;
        min-width: 320px;
        flex: 0 0 380px;
    }
    .desk-main .content {
        max-width: none;
        margin: 0;
    }

    /* Right panel */
    .desk-panel {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-width: 0;
        background: var(--bg);
        overflow: hidden;
    }
    .desk-panel-wide { flex: 1; }
    .desk-panel-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 20px;
        background: var(--bg2);
        border-bottom: 1px solid rgba(255,255,255,0.06);
        font-size: 13px;
        font-weight: 700;
        color: var(--text);
        flex-shrink: 0;
    }
    .desk-panel-head svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
    .desk-panel-head span { display: flex; align-items: center; gap: 8px; }
    .desk-panel-btn {
        padding: 5px 14px;
        background: var(--bg3);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 6px;
        color: var(--text2);
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.15s;
    }
    .desk-panel-btn:hover { background: var(--bg4); color: var(--text); border-color: rgba(255,255,255,0.15); }
    .desk-panel-body {
        flex: 1;
        overflow-y: auto;
        padding: 20px 24px;
    }
    .desk-panel-empty {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* ═══════ DESKTOP CHAT PANEL (dashboard right) ═══════ */
    .desk-chat-messages {
        flex: 1;
        overflow-y: auto;
        padding: 16px 20px;
    }
    .desk-chat-welcome {
        padding: 32px 16px;
        text-align: center;
        color: var(--text3);
    }
    .desk-chat-welcome p { font-size: 13px; margin-bottom: 16px; }
    .desk-chat-suggestions {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    .desk-chat-suggestions button {
        padding: 8px 14px;
        background: var(--bg3);
        border: 1px solid rgba(255,255,255,0.05);
        border-radius: 8px;
        color: var(--text2);
        font-size: 12px;
        font-weight: 500;
        cursor: pointer;
        text-align: left;
        transition: all 0.15s;
    }
    .desk-chat-suggestions button:hover { background: var(--bg4); color: var(--text); border-color: rgba(0,212,170,0.15); }

    .desk-chat-input {
        display: flex;
        gap: 8px;
        padding: 12px 16px;
        border-top: 1px solid rgba(255,255,255,0.06);
        background: var(--bg2);
        flex-shrink: 0;
    }
    .desk-chat-input input {
        flex: 1;
        padding: 10px 14px;
        background: var(--bg3);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 8px;
        color: var(--text);
        font-size: 13px;
        font-family: inherit;
        outline: none;
        transition: border-color 0.2s;
    }
    .desk-chat-input input:focus { border-color: var(--accent); }
    .desk-chat-input input::placeholder { color: var(--text3); }
    .desk-chat-input button {
        padding: 10px 14px;
        background: var(--accent);
        border: none;
        border-radius: 8px;
        color: #000;
        cursor: pointer;
        display: flex;
        align-items: center;
        transition: all 0.15s;
    }
    .desk-chat-input button:hover { box-shadow: 0 0 16px rgba(0,212,170,0.3); }

    /* Chat messages */
    .desk-msg { margin-bottom: 12px; max-width: 85%; }
    .desk-msg-user { margin-left: auto; }
    .desk-msg-user .desk-msg-bubble { background: rgba(0,212,170,0.12); color: var(--text); border-radius: 12px 12px 4px 12px; }
    .desk-msg-ai .desk-msg-bubble { background: var(--bg3); color: var(--text2); border-radius: 12px 12px 12px 4px; }
    .desk-msg-bubble { padding: 10px 14px; font-size: 13px; line-height: 1.6; }
    .desk-msg-typing { color: var(--text3); font-size: 12px; font-style: italic; padding: 8px 14px; }

    /* ═══════ HOLE HIGHLIGHT ON PROJECT LIST ═══════ */
    #holesList .card {
        transition: all 0.15s;
        border: 2px solid transparent;
    }
    #holesList .card:hover {
        border-color: rgba(0,212,170,0.15);
    }
    #holesList .card.desk-active {
        border-color: var(--accent);
        background: rgba(0,212,170,0.05);
    }

    /* ═══════ GENERAL OVERRIDES ═══════ */
    /* Headers */
    .screen .header { padding: 10px 20px; }
    .desk-main .header { padding: 10px 20px; }

    /* Auth screens */
    .auth-screen { max-width: 420px; margin: 40px auto; }

    /* Content defaults */
    .screen .content { padding: 16px 20px; }

    /* Photo grids */
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; }

    /* FAB: reposition inside desk-main so it doesn't overlap the chat panel */
    .desk-main .fab {
        position: absolute;
        top: 8px;
        right: 16px;
        bottom: auto;
        left: auto;
        width: 38px;
        height: 38px;
        font-size: 20px;
        border-radius: 10px;
        z-index: 10;
    }
    .desk-main { position: relative; }
    /* Keep standalone fab normal on other screens */
    .fab { bottom: 24px; right: 24px; }

    /* Modals */
    .modal { max-width: 560px; width: 90%; max-height: 85vh; }

    /* Settings */
    .settings-list { max-width: 600px; margin: 0 auto; }

    /* Subscription */
    .sub-card { max-width: 480px; margin: 40px auto; }

    /* GPS bar */
    .gps-bar { max-width: none; }

    /* Hide splash faster */
    #splashScreen { animation-delay: 1.5s !important; }

    /* Regs chat full screen: constrain on desktop */
    .regs-chat-messages { max-width: 720px; margin: 0 auto; }
    .regs-input-bar { max-width: 720px; margin: 0 auto; }
    .regs-welcome { max-width: 600px; margin: 40px auto; }

    /* Map */
    #mapContainer { flex: 1; }
    #reportFrame { flex: 1; }

    /* Tutorial */
    .tut-overlay { max-width: 640px; margin: 0 auto; border-radius: var(--radius); }

    /* Camera */
    .camera-view { max-width: 720px; margin: 0 auto; }

    /* Forms */
    .form-row { gap: 16px; }
    .auth-form { max-width: 500px; }

    /* Hide the standalone hole screen on desktop when in project view */
    /* (hole detail renders in right panel instead) */
}

/* ═══════ LIGHT THEME ═══════ */
@media (min-width: 1024px) {
    [data-theme="light"] .app-nav { background: #fff; border-right: 1px solid #e0e0e0; border-top: none; }
    [data-theme="light"] .app-nav .nav-item:hover { background: #f0f0f4; }
    [data-theme="light"] .app-nav .nav-item.active { background: rgba(0,180,150,0.08); }
    [data-theme="light"] .nav-brand { border-bottom-color: #e0e0e0; }
    [data-theme="light"] .desk-main { border-right-color: #e0e0e0; }
    [data-theme="light"] .desk-panel-head { background: #f8f8fa; border-bottom-color: #e0e0e0; }
    [data-theme="light"] .desk-chat-input { background: #f8f8fa; border-top-color: #e0e0e0; }
    [data-theme="light"] .desk-panel-btn { background: #eee; border-color: #ddd; color: #555; }
    [data-theme="light"] .desk-panel-btn:hover { background: #e0e0e0; color: #333; }
    [data-theme="light"] #holesList .card.desk-active { background: rgba(0,180,150,0.06); border-color: var(--accent); }
}

/* ═══════ MOBILE: hide desktop-only elements ═══════ */
@media (max-width: 1023px) {
    .desk-split { display: flex; flex-direction: column; flex: 1; min-height: 0; }
    .desk-main { max-width: none !important; flex: 1 !important; border-right: none !important; min-width: 0 !important; }
    .desk-main-narrow { max-width: none !important; flex: 1 !important; }
    .desk-panel { display: none !important; }
    .desk-panel-head, .desk-panel-body, .desk-panel-empty { display: none !important; }
}
