/* Datayard Section — iOS 26 Liquid Glass Design
   Scoped to #datayard-section and datayard-specific classes */

/* ── Section Background ─────────────────────────────────── */
#datayard-section {
    background: linear-gradient(160deg, #dbeafe 0%, #ede9fe 50%, #e0f2fe 100%);
    min-height: 100%;
    padding: 0.6rem 1.5rem 1.5rem;
    box-sizing: border-box;
}

/* ── Header ─────────────────────────────────────────────── */
#datayard-section .helppage-header {
    text-align: center;
    padding: 0.5rem 1.5rem 0.5rem;
    margin-bottom: 0.6rem;
}
#datayard-section .helppage-header h2 {
    font-size: 1.9rem;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 0.3rem;
    letter-spacing: -0.5px;
}
#datayard-section .helppage-header p {
    color: #64748b;
    font-size: 0.92rem;
    margin: 0;
}

/* ── Controls Bar ───────────────────────────────────────── */
#datayard-section .datayard-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.4rem;
    flex-wrap: wrap;
    padding: 0 0.2rem;
}

/* ── Drive folder config row ────────────────────────────── */
.drive-folder-config {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-top-color: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 5px 10px;
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 2px 6px rgba(0, 0, 0, 0.07);
}
.drive-folder-config label {
    font-size: 0.76rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}
.drive-folder-config input {
    border: none;
    background: transparent;
    font-size: 0.8rem;
    color: #1e293b;
    outline: none;
    width: 200px;
    font-family: ui-monospace, monospace;
}
.drive-folder-config input::placeholder { color: #94a3b8; }

/* ── Grid — horizontal wrap, equal-width cards ──────────── */
#datayard-section .helppage-grid {
    display: grid;
    /* auto-fill: pack as many columns as fit; 1fr ensures all columns
       in a row are always exactly equal width (= "widest group" rule). */
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    align-items: start; /* cards don't stretch to row height */
}

/* ── Group Card (outer wrapper) ─────────────────────────── */
#datayard-section .datayard-group-card {
    /* transparent wrapper; glass is on inner card */
}

/* ── Main Card — Liquid Glass ───────────────────────────── */
#datayard-section .helppage-main-card {
    background: rgba(255, 255, 255, 0.52);
    backdrop-filter: blur(28px) saturate(180%) brightness(1.04);
    -webkit-backdrop-filter: blur(28px) saturate(180%) brightness(1.04);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-top-color: rgba(255, 255, 255, 0.92);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}
#datayard-section .helppage-main-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, transparent 100%);
    border-radius: 20px 20px 0 0;
    pointer-events: none;
    z-index: 0;
}
#datayard-section .helppage-main-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 14px 42px rgba(0, 0, 0, 0.11),
        0 4px 10px rgba(0, 0, 0, 0.05);
}

/* ── Card Toggle Header ─────────────────────────────────── */
#datayard-section .helppage-main-toggle {
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem;
    position: relative;
    z-index: 1;
    gap: 12px;
}

/* ── Icon Box ───────────────────────────────────────────── */
#datayard-section .icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
}
#datayard-section .blue-bg    { background: linear-gradient(135deg, #60a5fa, #2563eb); }
#datayard-section .green-bg   { background: linear-gradient(135deg, #4ade80, #16a34a); }
#datayard-section .purple-bg  { background: linear-gradient(135deg, #c084fc, #7c3aed); }
#datayard-section .red-bg     { background: linear-gradient(135deg, #f87171, #dc2626); }
#datayard-section .yellow-bg  { background: linear-gradient(135deg, #fcd34d, #ca8a04); }
#datayard-section .emerald-bg { background: linear-gradient(135deg, #34d399, #059669); }
#datayard-section .pink-bg    { background: linear-gradient(135deg, #f472b6, #db2777); }
#datayard-section .amber-bg   { background: linear-gradient(135deg, #fbbf24, #d97706); }
#datayard-section .violet-bg  { background: linear-gradient(135deg, #a78bfa, #6d28d9); }

#datayard-section .blue-text,
#datayard-section .green-text,
#datayard-section .purple-text,
#datayard-section .red-text,
#datayard-section .yellow-text,
#datayard-section .emerald-text,
#datayard-section .pink-text,
#datayard-section .amber-text,
#datayard-section .violet-text { color: #fff !important; }

/* ── Title Group ────────────────────────────────────────── */
#datayard-section .header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
#datayard-section .title-group { min-width: 0; }
#datayard-section .title-group h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#datayard-section .title-group p {
    font-size: 0.77rem;
    color: #64748b;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Chevron ────────────────────────────────────────────── */
#datayard-section .main-chevron {
    transition: transform 0.25s ease;
    color: #94a3b8 !important;
    flex-shrink: 0;
}

/* ── Collapsed Content ──────────────────────────────────── */
#datayard-section .hidden-content:not(.hidden) {
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}
#datayard-section .sub-sections-container {
    padding: 0.6rem 0.8rem 0.9rem;
}
#datayard-section .datayard-items-container {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
    min-height: 36px;
}

/* ── File Item Wrapper ──────────────────────────────────── */
#datayard-section .file-item-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    animation: dy-item-in 0.22s ease both;
}
@keyframes dy-item-in {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── File Item Link ─────────────────────────────────────── */
#datayard-section .file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.48rem 0.85rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.48);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #1e40af;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    transition: background 0.17s, transform 0.15s;
}
#datayard-section .file-item:hover {
    background: rgba(255, 255, 255, 0.78);
    transform: translateX(3px);
    color: #1d4ed8;
}
#datayard-section .file-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#datayard-section .file-item .fa-file-alt { color: #3b82f6; flex-shrink: 0; }
#datayard-section .file-item .link-icon   { color: #94a3b8; flex-shrink: 0; }

/* ── Sortable Handle ────────────────────────────────────── */
#datayard-section .datayard-sortable-handle {
    cursor: grab;
    color: #94a3b8;
    padding: 0 3px;
    flex-shrink: 0;
}
#datayard-section .datayard-sortable-handle:active { cursor: grabbing; }

/* ── Item Edit Actions ──────────────────────────────────── */
#datayard-section .item-edit-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
#datayard-section .item-edit-actions button {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    transition: background 0.15s;
}
#datayard-section .item-edit-actions .edit-btn   { color: #3b82f6; }
#datayard-section .item-edit-actions .delete-btn { color: #ef4444; }
#datayard-section .item-edit-actions button:hover { background: rgba(255, 255, 255, 0.95); }

/* ── Edit-mode group card buttons ───────────────────────── */
#datayard-section .my-magic-edit-btn,
#datayard-section .my-magic-delete-btn,
#datayard-section .add-file-btn {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ── Sortable Ghost ─────────────────────────────────────── */
#datayard-section .sortable-ghost {
    opacity: 0.38;
    background: rgba(59, 130, 246, 0.12) !important;
    border: 1.5px dashed #93c5fd !important;
}

/* ── No Results ─────────────────────────────────────────── */
#datayard-section .no-results {
    color: #94a3b8;
    font-size: 0.84rem;
    text-align: center;
    padding: 0.9rem;
    margin: 0;
}

/* ── Cancel button — solid red, !important overrides btn-cancel class ── */
#datayard-cancel-edit-btn {
    background: #ef4444 !important;
    color: #fff !important;
    border: none !important;
}
#datayard-cancel-edit-btn:hover {
    background: #dc2626 !important;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.38) !important;
    transform: translateY(-2px);
}

/* ── Dark Mode ──────────────────────────────────────────── */
body.dark-mode #datayard-section {
    background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 50%, #0c1a2e 100%);
}
body.dark-mode #datayard-section .helppage-header h2 { color: #e2e8f0; }
body.dark-mode #datayard-section .helppage-header p  { color: #94a3b8; }

body.dark-mode #datayard-section .helppage-main-card {
    background: rgba(30, 41, 59, 0.62);
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.2);
}
body.dark-mode #datayard-section .title-group h3 { color: #e2e8f0; }
body.dark-mode #datayard-section .title-group p  { color: #64748b; }

body.dark-mode #datayard-section .file-item {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
    color: #93c5fd;
}
body.dark-mode #datayard-section .file-item:hover {
    background: rgba(255, 255, 255, 0.13);
    color: #bfdbfe;
}
body.dark-mode #datayard-section .hidden-content:not(.hidden) {
    border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .drive-folder-config {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(255, 255, 255, 0.1);
}
body.dark-mode .drive-folder-config label { color: #94a3b8; }
body.dark-mode .drive-folder-config input { color: #e2e8f0; }
