/* FlyTeam Logbook Templates Styles */
.page-template-page-my-logbook .container,
.post-type-archive-ft_flight .container,
.flyteam-logbook-dashboard .container {
    max-width: 1222px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
}

.flyteam-logbook-dashboard {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #334155; /* Global font color */
}

.flyteam-logbook-dashboard * {
    box-sizing: border-box;
}

.flyteam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.flyteam-header-info h1 {
    margin: 0;
    font-size: 1.875rem;
    font-weight: 700;
    color: #0f172a;
}

.flyteam-header-info p {
    margin: 0.25rem 0 0;
    color: #64748b;
}

.flyteam-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-left: auto;
}

/* Circular Buttons */
.flyteam-btn-circle {
    width: 44px;
    height: 44px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    text-decoration: none !important;
    flex-shrink: 0;
}

.flyteam-btn-upload {
    background: rgb(80, 133, 165);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(80, 133, 165, 0.2);
}

.flyteam-btn-upload:hover {
    background: rgb(60, 113, 145);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(80, 133, 165, 0.3);
}

.flyteam-btn-settings {
    background: #ffffff;
    color: #64748b;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.flyteam-btn-settings:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Dashboard Stats Container */
.flyteam-stats-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
}

.flyteam-stats-row .flyteam-card {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
}

.flyteam-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.flyteam-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.flyteam-stat-icon {
    width: 40px;
    height: 40px;
    background: rgba(80, 133, 165, 0.1);
    color: rgb(80, 133, 165);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.flyteam-stat-content {
    display: flex;
    flex-direction: column;
}

.flyteam-stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.flyteam-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.1;
    word-break: break-word;
}

@media (max-width: 640px) {
    .flyteam-stat-value {
        font-size: 1.5rem;
    }
}


.flyteam-stat-unit {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
}

.flyteam-table-container {
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.flyteam-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

/* Responsive Table Columns */
@media (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .flyteam-table td, .flyteam-table th {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.75rem !important;
    }

    .flyteam-table th.flyteam-cell-expand,
    .flyteam-table td.flyteam-cell-expand {
        min-width: 100px !important;
    }

    /* Modern Logbook Card Layout */
    .flyteam-table thead {
        display: none !important;
    }

    .flyteam-table, 
    .flyteam-table tbody {
        display: block !important;
        width: 100% !important;
        border: none !important;
    }

    .flyteam-table tr {
        display: block;
        width: 100% !important;
        border: none !important;
    }

    .flyteam-table tr.flyteam-row-main {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        margin-bottom: 8px !important;
        padding: 10px 12px !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        position: relative !important;
        overflow: hidden !important;
    }

    .flyteam-table td {
        display: inline-flex !important;
        padding: 0 !important;
        width: auto !important;
        flex-shrink: 0 !important;
        border: none !important;
        align-items: center !important;
        min-height: 0 !important;
        background: transparent !important;
    }

    /* Remove labels completely on mobile row-view */
    .flyteam-table td::before {
        display: none !important;
    }

    /* Column Specifics for One-Line */
    .flyteam-table td[data-label="Дата"] {
        order: 1;
        border-bottom: none !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        border-right: 1px solid #f1f5f9 !important;
        padding-right: 8px !important;
        margin-right: 4px !important;
    }

    .flyteam-table td[data-label="Дата"] .flyteam-date-sub {
        display: none !important; /* Hide time to save space */
    }

    .flyteam-table td[data-label="Место"] {
        order: 2;
        margin-bottom: 0 !important;
        flex: 1 !important;
        min-width: 100px;
    }

    .flyteam-spot-name {
        font-size: 0.85rem !important;
        font-weight: 700 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }

    .flyteam-admin-name, .flyteam-country-name, .flyteam-badge {
        display: none !important; /* Hide secondary info in main row */
    }

    .flyteam-table td[data-label="Дистанция"],
    .flyteam-table td[data-label="Высота"],
    .flyteam-table td[data-label="Время"],
    .flyteam-table td[data-label="Крыло"],
    .flyteam-table td[data-label="Пилот"] {
        order: 3;
        font-size: 0.75rem !important;
        margin-right: 4px !important;
    }

    .flyteam-dist-val, .flyteam-alt-val, .flyteam-speed-val {
        padding: 2px 6px !important;
        font-size: 0.7rem !important;
        border-radius: 4px !important;
    }

    .flyteam-table td.text-right {
        position: static !important;
        order: 4;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .flyteam-table tr.flyteam-details-row td {
        width: 100% !important;
        display: block !important;
        position: static !important;
        padding: 0 !important;
    }

    /* Hide text on buttons in mobile details */
    .flyteam-detail-actions .flyteam-btn-sm span {
        display: none !important;
    }
    
    .flyteam-detail-actions .flyteam-btn-sm {
        padding: 8px !important;
        min-width: 40px;
        justify-content: center;
    }

    .flyteam-row-actions {
        display: flex;
        align-items: center;
    }

    .flyteam-btn-icon {
        padding: 8px !important;
        background: #f1f5f9 !important;
        border-radius: 10px !important;
        color: #64748b !important;
    }

    /* Spot Name (The Main Event) */
    .flyteam-table td[data-label="Место"] {
        order: 3;
        margin-bottom: 8px;
    }

    .flyteam-spot-name {
        font-size: 1.125rem !important;
        font-weight: 800 !important;
        color: #0f172a !important;
        display: block;
        margin-bottom: 2px;
    }

    .flyteam-spot-cell {
        align-items: flex-start !important;
        gap: 2px !important;
    }

    .flyteam-country-name, .flyteam-admin-name {
        font-size: 0.8rem !important;
    }

    /* Stats Row (Horizontal Bottom) */
    .flyteam-table td[data-label="Дистанция"],
    .flyteam-table td[data-label="Высота"],
    .flyteam-table td[data-label="Время"],
    .flyteam-table td[data-label="Крыло"],
    .flyteam-table td[data-label="Пилот"] {
        order: 4;
        width: auto !important;
        display: inline-block !important;
        margin-right: 12px;
        margin-bottom: 4px;
    }

    /* Highlighting Stats */
    .flyteam-dist-val, .flyteam-alt-val, .flyteam-speed-val {
        background: #f8fafc;
        padding: 4px 10px;
        border-radius: 8px;
        font-weight: 700;
        font-size: 0.8rem;
        color: #475569;
        border: 1px solid #f1f5f9;
        display: inline-block;
    }

    .flyteam-dist-val {
        color: #2563eb;
        background: #eff6ff;
        border-color: #dbeafe;
    }

    /* Hide redundant elements if they mess up layout */
    .flyteam-table td.hide-narrow,
    .flyteam-table td.hide-tablet {
        display: none !important;
    }

    /* Pilot & Glider in a small row if visible */
    .flyteam-table td[data-label="Пилот"] .flyteam-pilot-link,
    .flyteam-glider-tag {
        font-size: 0.75rem !important;
        opacity: 0.8;
    }

    .flyteam-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1.5rem;
    }
    
    .flyteam-header-actions {
        margin-left: 0;
        width: auto;
        justify-content: flex-start;
    }

    .flyteam-stats-row .flyteam-card {
        min-width: calc(50% - 0.5rem);
        padding: 1rem;
    }

    .flyteam-stat-value {
        font-size: 1.1rem;
    }

    /* Hide WoodMart Sticky Toolbar on FlyTeam pages */
    .flyteam-logbook-dashboard ~ .wd-toolbar,
    .flyteam-single-flight-page ~ .wd-toolbar,
    #flyteam-root-container ~ .wd-toolbar,
    .wd-toolbar.wd-toolbar-label-show {
        display: none !important;
    }
    
    /* Ensure the root container can hide it if it's inside or outside */
    body.post-type-archive-ft_flight .wd-toolbar,
    body.single-ft_flight .wd-toolbar,
    body.page-template-page-my-logbook .wd-toolbar,
    body.tax-ft_glider .wd-toolbar {
        display: none !important;
    }

    .flyteam-filters {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .flyteam-filter-group {
        width: 100%;
    }

    .flyteam-filter-select {
        width: 100%;
    }
}

/* WoodMart My Account Navigation Icon Replacement - Hardened version */
.wd-my-acc-my-logbook .wd-nav-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    width: 55px !important;
    height: 55px !important;
}

.wd-my-acc-my-logbook .wd-nav-icon:before {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 55px !important;
    height: 55px !important;
    background-color: currentColor !important;
    -webkit-mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0yIDZoNCIvPjxwYXRoIGQ9Ik0yIDEwaDQiLz48cGF0aCBkPSJNMiAxNGg0Ii8+PHBhdGggZD0iTTIgMThoNCIvPjxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIyMCIgeD0iNCIgeT0iMiIgcng9IjIiLz48cGF0aCBkPSJNMTYgMnYyMCIvPjwvc3ZnPg==") center/contain no-repeat !important;
    mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0yIDZoNCIvPjxwYXRoIGQ9Ik0yIDEwaDQiLz48cGF0aCBkPSJNMiAxNGg0Ii8+PHBhdGggZD0iTTIgMThoNCIvPjxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIyMCIgeD0iNCIgeT0iMiIgcng9IjIiLz48cGF0aCBkPSJNMTYgMnYyMCIvPjwvc3ZnPg==") center/contain no-repeat !important;
}

/* Fallback for background-image if mask fails or is weirdly blocked */
.no-mask .wd-my-acc-my-logbook .wd-nav-icon:before {
    background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMzMzMiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNMiA2aDQiLz48cGF0aCBkPSJNMiAxMGg0Ii8+PHBhdGggZD0iTTIgMTRoNCIvPjxwYXRoIGQ9Ik0yIDE4aDQiLz48cmVjdCB3aWR0aD0iMTYiIGhlaWdodD0iMjAiIHg9IjQiIHk9IjIiIHJ4PSIyIi8+PHBhdGggZD0iTTE2IDJ2MjAiLz48L3N2Zz4=") center/contain no-repeat !important;
}

.wd-my-acc-my-logbook .wd-nav-icon:after {
    display: none !important;
}

@media (max-width: 480px) {
    .flyteam-stats-row .flyteam-card {
        min-width: 100%;
    }
}

.flyteam-table th {
    background: #f8fafc;
    padding: 1rem;
    font-weight: 700;
    font-size: 0.875rem;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.flyteam-table td {
    padding: 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    white-space: nowrap;
}

.flyteam-table th.flyteam-cell-expand,
.flyteam-table td.flyteam-cell-expand {
    white-space: normal;
    min-width: 150px;
    word-break: break-word;
}


.flyteam-table tr.flyteam-row-main {
    cursor: pointer;
    transition: background 0.2s;
}

.flyteam-table tr.flyteam-row-main:hover {
    background: #f8fafc;
}

.flyteam-details-row {
    background: #ffffff;
}

.flyteam-details-row.hidden {
    display: none;
}

.flyteam-details-content {
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    align-items: stretch;
}

.flyteam-details-map {
    flex: 0 0 320px;
    height: 240px;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
    position: relative !important;
    border: 1px solid #e2e8f0;
}

/* Ensure MapLibre container doesn't overflow */
.maplibregl-map {
    width: 100% !important;
    height: 100% !important;
    border-radius: 8px;
}

.flyteam-route-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1rem;
    border-left: 1px dashed #e2e8f0;
    border-right: 1px dashed #e2e8f0;
    width: 150px;
    flex: 0 0 150px;
    background: #fcfcfd;
}

.flyteam-route-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.flyteam-route-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0.35rem;
    max-width: 160px;
    white-space: normal;
    line-height: 1.2;
}

.flyteam-route-dots {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: #cbd5e1;
}

.flyteam-route-dot {
    width: 3px;
    height: 3px;
    background: currentColor;
    border-radius: 50%;
}

.flyteam-route-stats {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    background: #ffffff;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    white-space: nowrap;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.flyteam-marker-start-static, .flyteam-marker-end-static {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px currentColor;
}

.flyteam-marker-start-static {
    color: #22c55e;
    background: #22c55e;
}

.flyteam-marker-end-static {
    color: #ef4444;
    background: #ef4444;
}

.flyteam-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: inline-block;
}

.flyteam-badge-public {
    background: #22c55e;
    color: #ffffff;
}

.flyteam-badge-private {
    background: #94a3b8;
    color: #ffffff;
}

.flyteam-details-info {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    align-content: start;
}

.flyteam-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none !important;
}

.flyteam-btn-sm svg {
    width: 16px;
    height: 16px;
}

.flyteam-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.flyteam-detail-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    letter-spacing: 0.05em;
}

.flyteam-detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}

@media (max-width: 1024px) {
    .flyteam-details-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .flyteam-details-map {
        flex: 0 0 240px;
        width: 100%;
    }
    
    .flyteam-route-vertical {
        flex-direction: column;
        width: 100%;
        border-left: none;
        border-right: none;
        border-top: 1px dashed #e2e8f0;
        border-bottom: 1px dashed #e2e8f0;
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 768px) {
    .flyteam-details-map,
    .maplibregl-map {
        height: 300px !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
}

.flyteam-modal-close {
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
}

.flyteam-modal-close:hover {
    color: #1e293b;
}

.flyteam-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.flyteam-upload-zone {
    border: 2px dashed #e2e8f0;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: #f8fafc;
}

.flyteam-upload-zone:hover, .flyteam-upload-zone.active {
    border-color: rgb(80, 133, 165);
    background: rgba(80, 133, 165, 0.05);
}

.flyteam-upload-icon {
    color: rgb(80, 133, 165);
    text-align: center;
    display: inline-block;
}

.flyteam-upload-text {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.flyteam-upload-hint {
    font-size: 0.75rem;
    color: #64748b;
}

/* Filters */
.flyteam-filters {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.flyteam-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flyteam-filter-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.flyteam-filter-select {
    padding: 2px 24px 2px 8px !important;
    border-radius: 6px !important;
    border: 1px solid #e2e8f0 !important;
    background-color: #f8fafc !important;
    font-size: 12px !important;
    color: #1e293b !important;
    cursor: pointer !important;
    min-width: 110px !important;
    height: 28px !important;
    line-height: 1 !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.3rem center !important;
    background-size: 0.75rem !important;
}

.flyteam-filter-select:focus {
    outline: none;
    border-color: rgb(80, 133, 165);
    box-shadow: 0 0 0 2px rgba(80, 133, 165, 0.1);
}

.flyteam-filter-btn {
    padding: 0.5rem 1.25rem;
    background: #f1f5f9;
    color: #475569;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.flyteam-filter-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}



.text-flyteam-primary {
    color: rgb(80, 133, 165) !important;
}

.bg-flyteam-primary {
    background-color: rgb(80, 133, 165) !important;
}

.border-flyteam-primary {
    border-color: rgb(80, 133, 165) !important;
}

.flyteam-marker-start, .flyteam-marker-end {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}
.flyteam-marker-start { background: #22c55e; }
.flyteam-marker-end { background: #ef4444; }

.hidden {
    display: none !important;
}

.bg-flyteam-primary:hover {
    background-color: rgb(60, 113, 145) !important;
}

.flyteam-flag-icon {
    width: 24px !important;
    height: 16px !important;
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    object-fit: cover;
}

.flyteam-spot-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 4px 0;
}

.flyteam-country-name {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

/* Glider Taxonomy Styles */
.tax-ft_glider .flyteam-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 3rem 2rem;
    border-radius: 8px;
    margin-bottom: 3rem;
    border: 1px solid #e2e8f0;
}

.tax-ft_glider .flyteam-header-info h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tax-ft_glider .flyteam-stats-row {
    margin-top: -2rem;
    padding: 0 1rem;
}

.tax-ft_glider .flyteam-card {
    border-radius: 8px;
}

.tax-ft_glider .flyteam-table-container {
    box-shadow: 0 4px 20px -5px rgba(0,0,0,0.05);
}
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination .page-numbers {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #475569;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination .page-numbers:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.pagination .current {
    background: rgb(80, 133, 165) !important;
    color: white !important;
    border-color: rgb(80, 133, 165) !important;
}

/* Modals */
.flyteam-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.flyteam-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.flyteam-modal {
    background: #ffffff;
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.flyteam-modal-overlay.active .flyteam-modal {
    transform: scale(1);
}

.flyteam-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flyteam-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

/* Hide WoodMart theme elements on logbook page */
.page-template-page-my-logbook .wd-page-title,
.page-template-page-my-logbook .wd-prefooter,
.page-template-templatespage-my-logbook-php .wd-page-title,
.page-template-templatespage-my-logbook-php .wd-prefooter,
.post-type-archive-ft_flight .wd-page-title,
.post-type-archive-ft_flight .wd-prefooter {
    display: none !important;
}

.flyteam-btn-detail {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
}

.flyteam-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 1.5rem;
    border-left: 1px solid #f1f5f9;
    min-width: 180px;
    justify-content: center;
}

@media (max-width: 1024px) {
    .flyteam-details-content {
        flex-direction: column;
    }
    
    .flyteam-detail-actions {
        flex-direction: row;
        border-left: none;
        border-top: 1px solid #f1f5f9;
        padding-left: 0;
        padding-top: 1.5rem;
        margin-top: 0.5rem;
        min-width: 0;
        justify-content: flex-start;
    }
}

.flyteam-btn-view {
    background: #3b82f6 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.flyteam-btn-view:hover {
    background: #2563eb !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.flyteam-btn-edit {
    background: #f8fafc !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

.flyteam-btn-edit:hover {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px);
}

.flyteam-btn-delete {
    background: #fff1f2 !important;
    color: #e11d48 !important;
    border: 1px solid #ffe4e6 !important;
}

.flyteam-btn-delete:hover {
    background: #ffe4e6 !important;
    color: #be123c !important;
    border-color: #fecdd3 !important;
    transform: translateY(-1px);
}

/* Viewer Page Layout */
.flyteam-viewer-layout {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    align-items: stretch;
}

.flyteam-viewer-sidebar {
    flex: 0 0 320px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.flyteam-viewer-main {
    flex: 1;
    min-width: 0;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    min-height: 100%;
}

.flyteam-sidebar-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.flyteam-sidebar-header h1 {
    font-size: 22px !important;
    color: #0f172a;
    line-height: 1.2;
}

.flyteam-sidebar-header a {
    color: inherit;
    text-decoration: none;
}

.flyteam-sidebar-header a:hover {
    color: rgb(80, 133, 165);
}

.flyteam-marker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.flyteam-marker-start { 
    background: #22c55e !important; 
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}
.flyteam-marker-finish { 
    background: #ef4444 !important; 
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.flyteam-viewer-sidebar .flyteam-details-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.flyteam-viewer-sidebar .flyteam-detail-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.flyteam-viewer-sidebar .flyteam-detail-item:last-child {
    border-bottom: none;
}

.flyteam-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.flyteam-sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flyteam-sidebar-section-title svg {
    width: 12px;
    height: 12px;
}

.flyteam-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.flyteam-detail-label-with-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
}

.flyteam-detail-label-with-icon svg {
    width: 14px;
    height: 14px;
    color: #94a3b8;
}

.flyteam-detail-value-bold {
    font-weight: 700;
    color: #1e293b;
}

.flyteam-sidebar-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.flyteam-comment-sidebar {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.flyteam-viewer-sidebar .flyteam-route-vertical {
    width: 100% !important;
    flex: none !important;
    border-left: none !important;
    border-right: none !important;
    background: #f8fafc !important;
    padding: 1rem !important;
    border-radius: 8px !important;
    border: 1px solid #f1f5f9 !important;
    margin: 0.5rem 0;
}

/* Viewer Map Switcher */
.flyteam-map-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.map-style-btn {
    padding: 6px 5px !important;
    font-size: 10px !important;
    font-weight: 700;
    border-radius: 6px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    background: transparent;
    color: #64748b;
}

.map-style-btn.active {
    background: #5085a5 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.map-style-btn:not(.active):hover {
    background: #f1f5f9;
    color: #0f172a;
}

.flyteam-details-map-viewer {
    height: 600px;
    min-height: 100%;
    background: #f8fafc;
    position: relative;
    border-radius: 0 8px 8px 0;
}

@media (max-width: 1024px) {
    .flyteam-viewer-layout {
        flex-direction: column;
    }
    .flyteam-viewer-sidebar {
        flex: none;
        width: 100%;
    }
    .flyteam-details-map-viewer {
        height: 400px;
        min-height: 400px;
        border-radius: 0 0 8px 8px;
    }
}

/* Full-window pseudo-fullscreen for iPhone/Safari */
.is-pseudo-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  background: white !important;
  margin: 0 !important;
  padding: 0 !important;
}

#flyteam-root-container.has-pseudo-fullscreen .is-pseudo-fullscreen {
  height: 100vh !important;
  border-radius: 0 !important;
}

#flyteam-root-container.has-pseudo-fullscreen .is-pseudo-fullscreen .flyteam-map-toolbar {
  top: env(safe-area-inset-top, 20px) !important;
  left: env(safe-area-inset-left, 10px) !important;
  right: env(safe-area-inset-right, 10px) !important;
}

/* iOS Style Switch */
.flyteam-status-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.flyteam-switch-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.flyteam-switch-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background-color: #cbd5e1;
    border-radius: 34px;
    transition: .3s;
}

.flyteam-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.flyteam-switch-input:checked + .flyteam-switch-slider {
    background-color: #22c55e;
}

.flyteam-switch-input:checked + .flyteam-switch-slider:before {
    transform: translateX(18px);
}

.flyteam-switch-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #94a3b8;
    transition: .3s;
}

.flyteam-switch-label svg {
    width: 18px;
    height: 18px;
}

.flyteam-switch-label .icon-public,
.flyteam-switch-label .icon-private {
    display: none;
}

.flyteam-switch-input:checked ~ .flyteam-switch-label {
    color: #22c55e;
}

.flyteam-switch-input:checked ~ .flyteam-switch-label .icon-public {
    display: block;
}

.flyteam-switch-input:not(:checked) ~ .flyteam-switch-label .icon-private {
    display: block;
}

.flyteam-status-loading {
    opacity: 0.5;
    pointer-events: none;
}

.flyteam-status-switch-sm .flyteam-switch-slider {
    width: 32px;
    height: 18px;
}

.flyteam-status-switch-sm .flyteam-switch-slider:before {
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
}

.flyteam-status-switch-sm .flyteam-switch-input:checked + .flyteam-switch-slider:before {
    transform: translateX(14px);
}

.flyteam-btn-nearby-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flyteam-btn-nearby-toggle:hover {
    color: #3b82f6;
    border-color: #3b82f6;
    background: #eff6ff;
}

.flyteam-btn-nearby-toggle.active {
    color: #ffffff;
    background: #3b82f6;
    border-color: #2563eb;
}

.flyteam-btn-nearby-toggle.is-loading {
    animation: flyteam-pulse 1.5s infinite ease-in-out;
    pointer-events: none;
}

@keyframes flyteam-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

