/* ============================================================
   Intellectra Study Materials – Shared Styles
   intellectra-materials.css
   ============================================================ */

:root {
    --im-primary:    #4f46e5;
    --im-primary-dk: #3730a3;
    --im-success:    #059669;
    --im-danger:     #dc2626;
    --im-bg:         #f8f9fc;
    --im-card:       #ffffff;
    --im-border:     #e5e7eb;
    --im-text:       #111827;
    --im-muted:      #6b7280;
    --im-radius:     12px;
    --im-shadow:     0 2px 12px rgba(0,0,0,.07);
}

/* ── Wrapper ── */
.im-wrap { font-family: 'Segoe UI', sans-serif; max-width: 820px; margin: 0 auto; color: var(--im-text); }

/* ── Tabs ── */
.im-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 2px solid var(--im-border); padding-bottom: 0; }
.im-tab  { background: none; border: none; cursor: pointer; padding: 10px 20px; font-size: 15px; font-weight: 600; color: var(--im-muted); border-bottom: 3px solid transparent; margin-bottom: -2px; border-radius: 0; transition: all .2s; }
.im-tab:hover  { color: var(--im-primary); }
.im-tab.active { color: var(--im-primary); border-bottom-color: var(--im-primary); }
.im-tab-content { display: none; } .im-tab-content.active { display: block; }

/* ── Card ── */
.im-card { background: var(--im-card); border: 1px solid var(--im-border); border-radius: var(--im-radius); padding: 28px; box-shadow: var(--im-shadow); }
.im-card-title { margin: 0 0 4px; font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.im-card-sub   { margin: 0 0 20px; color: var(--im-muted); font-size: 14px; }
.im-card-header-row { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }

/* ── Form ── */
.im-field    { margin-bottom: 18px; }
.im-label    { display: block; font-size: 13px; font-weight: 600; color: var(--im-text); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.im-opt      { font-weight: 400; color: var(--im-muted); text-transform: none; letter-spacing: 0; }
.im-input, .im-select, .im-textarea {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--im-border);
    border-radius: 8px; font-size: 15px; color: var(--im-text);
    background: #fff; box-sizing: border-box; transition: border-color .2s;
}
.im-input:focus, .im-select:focus, .im-textarea:focus { outline: none; border-color: var(--im-primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.im-textarea { resize: vertical; min-height: 80px; }
.im-select-sm { width: auto; padding: 7px 12px; font-size: 14px; }

/* ── Type Cards ── */
.im-type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.im-type-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; border: 2px solid var(--im-border); border-radius: 10px; cursor: pointer; transition: all .2s; background: #fafafa; }
.im-type-card input { display: none; }
.im-type-card:hover   { border-color: var(--im-primary); background: #eef2ff; }
.im-type-card.selected { border-color: var(--im-primary); background: #eef2ff; box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.im-type-icon  { font-size: 24px; }
.im-type-label { font-size: 13px; font-weight: 600; color: var(--im-text); }

/* ── Drop Zone ── */
.im-drop-zone { border: 2px dashed var(--im-border); border-radius: 10px; padding: 28px 20px; text-align: center; cursor: pointer; transition: all .2s; background: #fafafa; }
.im-drop-zone:hover, .im-drop-zone.im-drag-over { border-color: var(--im-primary); background: #eef2ff; }
.im-drop-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.im-drop-zone p { margin: 0; color: var(--im-muted); font-size: 14px; }
.im-drop-link { color: var(--im-primary); font-weight: 600; text-decoration: underline; }
.im-drop-preview { display: flex; align-items: center; justify-content: center; gap: 12px; }
.im-drop-filename { font-size: 14px; font-weight: 600; color: var(--im-success); }
.im-drop-remove { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--im-danger); }

/* ── Buttons ── */
.im-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; border: none; transition: all .2s; }
.im-btn-primary { background: var(--im-primary); color: #fff; }
.im-btn-primary:hover { background: var(--im-primary-dk); }
.im-btn-outline { background: #fff; color: var(--im-primary); border: 1.5px solid var(--im-primary); font-size: 13px; padding: 7px 14px; }
.im-btn-outline:hover { background: #eef2ff; text-decoration: none; }
.im-btn-danger  { background: #fef2f2; color: var(--im-danger); border: 1.5px solid #fecaca; font-size: 13px; padding: 7px 14px; }
.im-btn-danger:hover { background: #fee2e2; }
.im-btn-sm { background: #f3f4f6; color: var(--im-text); padding: 7px 14px; font-size: 13px; border: 1px solid var(--im-border); }
.im-btn-sm:hover { background: #e5e7eb; }
.im-btn:disabled { opacity: .55; cursor: not-allowed; }
.im-action-btn { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; border-radius: 7px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s; }

/* ── Alert ── */
.im-alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; margin-top: 16px; }
.im-alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.im-alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Material List ── */
.im-material-list { display: flex; flex-direction: column; gap: 12px; }
.im-material-item {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 16px; border: 1.5px solid var(--im-border);
    border-radius: 10px; background: #fff; transition: box-shadow .2s;
    position: relative;
}
.im-material-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.im-material-new { border-left: 4px solid var(--im-primary); background: #fafbff; }
.im-material-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.im-material-body { flex: 1; min-width: 0; }
.im-material-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.im-material-desc  { font-size: 13px; color: var(--im-muted); margin-bottom: 8px; line-height: 1.5; }
.im-material-meta  { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.im-material-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }

/* ── Badges ── */
.im-badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.im-badge-pdf     { background: #dbeafe; color: #1e40af; }
.im-badge-youtube { background: #fee2e2; color: #991b1b; }
.im-badge-loom    { background: #ede9fe; color: #5b21b6; }
.im-badge-link    { background: #d1fae5; color: #065f46; }
.im-meta-date { font-size: 12px; color: var(--im-muted); }
.im-meta-for  { font-size: 12px; color: var(--im-primary); font-weight: 600; }

/* ── New Pill ── */
.im-new-pill { display: inline-block; background: var(--im-primary); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px; vertical-align: middle; margin-left: 6px; }

/* ── Unseen Badge ── */
.im-unseen-badge { display: inline-flex; align-items: center; justify-content: center; background: var(--im-danger); color: #fff; font-size: 11px; font-weight: 700; width: 22px; height: 22px; border-radius: 50%; }

/* ── Stats Row ── */
.im-stats-row { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.im-stat { background: #f8f9fc; border: 1px solid var(--im-border); border-radius: 8px; padding: 12px 20px; text-align: center; flex: 1; }
.im-stat-num   { display: block; font-size: 22px; font-weight: 800; color: var(--im-primary); }
.im-stat-label { display: block; font-size: 12px; color: var(--im-muted); font-weight: 600; text-transform: uppercase; }

/* ── Tutor Group Label ── */
.im-tutor-group-label { font-size: 13px; font-weight: 700; color: var(--im-muted); text-transform: uppercase; letter-spacing: .5px; margin: 16px 0 8px; }

/* ── YouTube Thumb ── */
.im-yt-thumb { position: relative; width: 100px; flex-shrink: 0; border-radius: 8px; overflow: hidden; cursor: pointer; }
.im-yt-thumb img { width: 100%; height: 60px; object-fit: cover; display: block; }
.im-yt-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.3); color: #fff; font-size: 20px; }

/* ── Skeleton ── */
.im-skeleton-wrap { display: flex; flex-direction: column; gap: 12px; }
.im-skeleton { height: 80px; border-radius: 10px; background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%); background-size: 200% 100%; animation: im-shimmer 1.4s infinite; }
@keyframes im-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Empty State ── */
.im-empty { text-align: center; padding: 48px 20px; color: var(--im-muted); font-size: 15px; }

/* ── Filter Row ── */
.im-filter-row { display: flex; align-items: center; gap: 8px; }

/* ── Responsive ── */
@media(max-width: 600px){
    .im-type-grid { grid-template-columns: repeat(2, 1fr); }
    .im-material-item { flex-wrap: wrap; }
    .im-material-actions { flex-direction: row; width: 100%; }
    .im-stats-row { gap: 8px; }
    .im-card { padding: 18px; }
    .im-card-header-row { flex-direction: column; }
}
