/* ========== New mobile job tracker layout (reference design) ========== */
.job-tracker-mobile-wrap,
#mobile-tab-nav {
    display: none;
}

@media (max-width: 768px) {
    /* Hide duplicate mobile tab row; keep single tab row (the one with icons) */
    #mobile-tab-nav {
        display: none !important;
    }
    .job-tracker-mobile-wrap {
        display: block !important;
        padding-bottom: 5.5rem;
        min-height: 60vh;
    }
    #jobs-tab .status-progress-bar,
    #jobs-tab .top-control-bar,
    #jobs-tab .modern-search-bar,
    #jobs-tab #combinedTrackerSearch,
    #jobs-tab .active-filters,
    #jobs-tab #jobActionBar,
    #jobs-tab #jobs-table-view,
    #jobs-tab .job-table-container {
        display: none !important;
    }
}
@media (max-width: 1200px) {
    /* Hide duplicate mobile tab row; keep single tab row (the one with icons) */
    #mobile-tab-nav {
        display: none !important;
    }
    .job-tracker-mobile-wrap {
        display: block !important;
        padding-bottom: 5.5rem;
        min-height: 60vh;
    }
    #jobs-tab .status-progress-bar,
    #jobs-tab .top-control-bar,
    #jobs-tab .modern-search-bar,
    #jobs-tab #combinedTrackerSearch,
    #jobs-tab .active-filters,
    #jobs-tab #jobActionBar,
    #jobs-tab #jobs-table-view,
    #jobs-tab .job-table-container {
        display: none !important;
    }
    /* Do NOT hide the main .job-nav-tabs so only one row shows (no duplicate) */
    .mobile-tab-nav.job-nav-tabs {
        display: none !important;
    }
    .mobile-tab-nav .job-nav-btn {
        flex: 1;
        padding: 1rem 0.5rem;
        border: none;
        background: transparent;
        color: #64748b;
        font-size: 0.9375rem;
        font-weight: 500;
        border-bottom: 3px solid transparent;
        margin-bottom: -1px;
    }
    .mobile-tab-nav .job-nav-btn.active {
        color: #2563eb;
        border-bottom-color: #2563eb;
        font-weight: 600;
    }
    .mobile-tab-nav .job-nav-btn i {
        display: none;
    }
    .mobile-analytics-section {
        padding: 1rem;
        padding-top: 0 !important; /* Sit exactly below navbar */
    }
    .mobile-funnel-card {
        background: #fff;
        border-radius: 1rem;
        padding: 1rem;
        box-shadow: 0 2px 12px -2px rgba(0,0,0,0.08);
        border: 1px solid #f1f5f9;
    }
    .mobile-funnel-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
    }
    .mobile-funnel-title {
        font-weight: 700;
        color: #1e293b;
        font-size: 1rem;
        margin: 0;
    }
    .mobile-funnel-period {
        font-size: 0.75rem;
        color: #2563eb;
        font-weight: 600;
        background: #eff6ff;
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
    }
    .mobile-funnel-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .mobile-funnel-block {
        text-align: left;
        padding: 0.75rem;
        border-radius: 0.75rem;
        border: 2px solid #e2e8f0;
        background: #f8fafc;
        cursor: pointer;
    }
    .mobile-funnel-block-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.5rem;
    }
    .mobile-funnel-icon {
        width: 2rem;
        height: 2rem;
        border-radius: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem;
    }
    .mobile-funnel-icon-bookmarked {
        background: #e2e8f0;
        color: #64748b;
    }
    .mobile-funnel-block-applied { background: #eff6ff; border-color: #2563eb; }
    .mobile-funnel-block-applied .mobile-funnel-icon-applied { background: #2563eb; color: #fff; }
    .mobile-funnel-block-applied .mobile-funnel-count,
    .mobile-funnel-block-applied .mobile-funnel-label { color: #2563eb; font-weight: 600; }
    .mobile-funnel-block-interview { background: #ecfdf5; border-color: #10b981; }
    .mobile-funnel-block-interview .mobile-funnel-icon-interview { background: #10b981; color: #fff; }
    .mobile-funnel-block-interview .mobile-funnel-count,
    .mobile-funnel-block-interview .mobile-funnel-label { color: #10b981; font-weight: 600; }
    .mobile-funnel-block-offer { background: #f5f3ff; border-color: #8b5cf6; }
    .mobile-funnel-block-offer .mobile-funnel-icon-offer { background: #8b5cf6; color: #fff; }
    .mobile-funnel-block-offer .mobile-funnel-count,
    .mobile-funnel-block-offer .mobile-funnel-label { color: #8b5cf6; font-weight: 600; }
    .mobile-funnel-count { font-size: 1.5rem; font-weight: 700; color: #1e293b; }
    .mobile-funnel-label { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; color: #64748b; margin: 0; }
    .mobile-search-section { padding: 0 1rem 1rem; }
    .mobile-search-row { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
    .mobile-search-input-wrapper { flex: 1; position: relative; }
    .mobile-search-icon {
        position: absolute;
        left: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        color: #94a3b8;
        font-size: 0.875rem;
    }
    .mobile-search-input {
        width: 100%;
        padding: 0.75rem 1rem 0.75rem 2.25rem;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 0.75rem;
        font-size: 0.875rem;
        color: #1e293b;
        outline: none;
    }
    .mobile-search-input:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
    }
    .mobile-filter-btn {
        width: 3rem;
        height: 3rem;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #64748b;
        cursor: pointer;
    }
    .mobile-status-filter-wrapper {
        position: relative;
    }
    .mobile-status-filter-btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 0.75rem;
        font-size: 0.875rem;
        font-weight: 500;
        color: #334155;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    .mobile-status-filter-chevron { font-size: 0.75rem; color: #94a3b8; transition: transform 0.2s; }
    .mobile-status-filter-btn[aria-expanded="true"] .mobile-status-filter-chevron { transform: rotate(180deg); }
    .mobile-status-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-top: 0.5rem;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 0.75rem;
        box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
        z-index: 999;
        overflow: hidden;
    }
    .mobile-status-dropdown[hidden] { display: none !important; }
    .mobile-status-option {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        min-height: 2.75rem;
        background: #fff;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        font-size: 0.875rem;
        font-weight: 600;
        color: #1e293b;
        text-align: left;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    .mobile-status-option:hover { background: #f8fafc; }
    .mobile-status-option-count { font-size: 0.75rem; color: #64748b; font-weight: 500; }
    .mobile-jobs-list-section { padding: 0 1rem 1rem; }
    .mobile-jobs-list { display: flex; flex-direction: column; gap: 0.75rem; }
    .mobile-job-card {
        background: #fff;
        padding: 1rem;
        border-radius: 1rem;
        box-shadow: 0 2px 12px -2px rgba(0,0,0,0.08);
        border: 1px solid #f1f5f9;
        position: relative;
        overflow: visible;
    }
    .mobile-job-card-status-applied { background: rgba(16,185,129,0.15); color: #10b981; }
    .mobile-job-card-status-bookmarked { background: #f1f5f9; color: #64748b; }
    .mobile-job-card-status-interviewing { background: rgba(37,99,235,0.15); color: #2563eb; }
    .mobile-job-card-status-negotiating { background: rgba(139,92,246,0.15); color: #8b5cf6; }
    .mobile-job-card-status-dropdown {
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        margin-bottom: 0.25rem;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
        z-index: 50;
        min-width: 120px;
    }
    .mobile-status-dropdown {
        width: 100%;
        padding: 0.5rem;
        border: none;
        background: transparent;
        font-size: 0.875rem;
        color: #1e293b;
        outline: none;
    }
    .mobile-job-card-main { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; }
    .mobile-job-card-logo {
        width: 3rem;
        height: 3rem;
        border-radius: 0.75rem;
        background: #f8fafc;
        border: 1px solid #f1f5f9;
        overflow: hidden;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .mobile-job-card-logo img { width: 100%; height: 100%; object-fit: cover; }
    .mobile-job-card-logo .mobile-job-card-logo-placeholder { font-size: 1.25rem; color: #94a3b8; }
    .mobile-job-card-title { font-weight: 700; color: #1e293b; font-size: 1rem; line-height: 1.25; margin: 0 0 0.25rem 0; }
    .mobile-job-card-meta { font-size: 0.875rem; color: #64748b; margin: 0; }
    .mobile-job-card-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-top: 0.75rem;
        border-top: 1px solid #f8fafc;
        gap: 0.5rem;
    }
    .mobile-job-card-footer-left {
        position: relative;
        flex-shrink: 0;
    }
    .mobile-job-card-status {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        padding: 0.25rem 0.5rem;
        font-size: 0.6875rem;
        font-weight: 600;
        text-transform: uppercase;
        border-radius: 9999px;
        cursor: pointer;
        user-select: none;
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
    }
    .mobile-job-card-status-text { display: inline; }
    .mobile-job-card-status-chevron {
        font-size: 0.5rem;
        opacity: 0.9;
    }
    .mobile-job-card-status-dropdown {
        position: absolute;
        bottom: 100%;
        left: 0;
        transform: none;
        margin-bottom: 0.25rem;
    }
    .mobile-job-card-actions { display: flex; gap: 0.5rem; margin-left: auto; }
    .mobile-job-card-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        font-weight: 600;
        border-radius: 0.5rem;
        border: none;
        cursor: pointer;
        transition: background-color 0.2s;
    }
    .mobile-job-card-btn-prep { background: #2563eb; color: #fff; }
    .mobile-job-card-btn-details { background: #eff6ff; color: #2563eb; }
    #job-tracker-mobile-wrap .mobile-fab {
        position: fixed;
        bottom: 5.5rem;
        right: 1.5rem;
        width: 3.5rem;
        height: 3.5rem;
        background: #2563eb;
        color: #fff;
        border: none;
        border-radius: 50%;
        box-shadow: 0 4px 14px rgba(37,99,235,0.4);
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        z-index: 40;
        cursor: pointer;
    }
    #job-tracker-mobile-wrap .mobile-fab:active { transform: scale(0.95); }
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 5rem;
        background: #fff;
        border-top: 1px solid #f1f5f9;
        padding: 0 1.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        z-index: 50;
    }
    .mobile-bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        color: #94a3b8;
        font-size: 0.625rem;
        font-weight: 500;
        text-decoration: none;
        padding: 0.25rem;
    }
    .mobile-bottom-nav-item i { font-size: 1.125rem; }
    .mobile-bottom-nav-item-active { color: #2563eb; font-weight: 700; }
}

@media (min-width: 1201px) {
    .job-tracker-mobile-wrap,
    #job-tracker-mobile-wrap .mobile-fab,
    #mobile-tab-nav {
        display: none !important;
    }
}
