/* SecureDrop — Frontend (shortcode dashboard) styles */

.sd-wrap { max-width: 900px; margin: 0 auto; padding: 0 12px 60px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; }

/* Top bar */
.sd-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 0; margin-bottom: 4px; border-bottom: 2px solid #e8ecf0;
}
.sd-topbar-logo { max-height: 40px; margin-right: 10px; vertical-align: middle; }
.sd-topbar-title { font-size: 1.15rem; font-weight: 700; }
.sd-topbar-user  { font-size: .9rem; color: #555; display: flex; align-items: center; gap: 12px; }
.sd-btn-logout {
    padding: 6px 14px; background: #dc3545; color: #fff;
    border-radius: 5px; text-decoration: none; font-size: .85rem; transition: background .2s;
}
.sd-btn-logout:hover { background: #b02a37; color: #fff; }
.sd-back { color: #0073e6; text-decoration: none; font-size: .9rem; }
.sd-back:hover { text-decoration: underline; }

/* Card */
.sd-card {
    background: #fff; border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    padding: 24px; margin-bottom: 20px;
}
.sd-card h2 { font-size: 1.1rem; margin-bottom: 18px; color: #1a1a2e; }
.sd-card h3 { font-size: 1rem; margin-bottom: 14px; color: #1a1a2e; }

/* Form elements */
.sd-form-grid { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.sd-field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 5px; color: #333; }
.sd-field input[type="text"],
.sd-field input[type="email"],
.sd-field input[type="number"],
.sd-field input[type="date"],
.sd-field input[type="url"],
.sd-field textarea {
    display: block; width: 100%; padding: 9px 12px;
    border: 1.5px solid #d0d7de; border-radius: 6px;
    font-size: .93rem; transition: border-color .2s;
}
.sd-field input:focus, .sd-field textarea:focus {
    outline: none; border-color: #0073e6; box-shadow: 0 0 0 3px rgba(0,115,230,.12);
}
.sd-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sd-req  { color: #dc3545; }
.sd-hint { font-size: .78rem; color: #888; font-weight: 400; margin-left: 4px; }

/* File type checkboxes */
.sd-type-checkboxes { display: flex; flex-wrap: wrap; gap: 10px; }
.sd-type-group {
    display: flex; align-items: flex-start; gap: 7px;
    background: #f6f8fa; border: 1.5px solid #d0d7de; border-radius: 6px;
    padding: 8px 12px; cursor: pointer; font-size: .88rem; font-weight: 600;
    transition: border-color .2s;
}
.sd-type-group:hover { border-color: #0073e6; }
.sd-type-group input { margin-top: 2px; }
.sd-type-sub { font-size: .73rem; color: #888; font-weight: 400; display: block; margin-top: 2px; }

/* Buttons */
.sd-btn {
    display: inline-block; padding: 9px 18px; border: none; border-radius: 6px;
    font-size: .9rem; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: filter .2s; line-height: 1.4;
}
.sd-btn:hover { filter: brightness(1.1); }
.sd-btn-primary { background: #0073e6; color: #fff; }
.sd-btn-success { background: #28a745; color: #fff; }
.sd-btn-danger  { background: #dc3545; color: #fff; }
.sd-btn-sm  { padding: 6px 12px; font-size: .82rem; }
.sd-btn-xs  { padding: 4px 9px;  font-size: .76rem; }
.sd-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Messages */
.sd-msg { padding: 11px 14px; border-radius: 6px; margin-bottom: 14px; font-size: .9rem; }
.sd-error   { background: #fde8e8; color: #c0392b; border: 1px solid #f5c6cb; }
.sd-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.sd-error-msg { color: #c0392b; font-weight: 600; padding: 20px 0; }

/* Result box */
.sd-result-box {
    background: #f0f7ff; border: 1.5px solid #b8d9f8;
    border-radius: 8px; padding: 18px; margin-top: 18px;
}
.sd-result-box h3 { color: #155724; margin-bottom: 8px; }
.sd-copy-row { display: flex; gap: 8px; }
.sd-copy-row input { flex: 1; font-family: monospace; font-size: .85rem; padding: 8px 10px;
                     border: 1px solid #ccc; border-radius: 5px; }

/* Invitation list */
.sd-inv-list { display: flex; flex-direction: column; gap: 12px; }
.sd-inv-row {
    border: 1.5px solid #e0e6ed; border-radius: 8px; padding: 14px 16px;
    display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap;
}
.sd-inv-info  { flex: 1; min-width: 0; }
.sd-inv-title { font-size: .95rem; font-weight: 700; margin-bottom: 5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sd-inv-title a { color: #1a1a2e; text-decoration: none; }
.sd-inv-title a:hover { color: #0073e6; }
.sd-inv-meta  { font-size: .8rem; color: #777; margin-bottom: 6px; }
.sd-inv-url   { font-size: .78rem; color: #555; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sd-inv-url span { font-family: monospace; background: #f3f4f6; padding: 2px 6px; border-radius: 3px; word-break: break-all; }
.sd-inv-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; flex-shrink: 0; }
.sd-empty { color: #888; font-size: .9rem; padding: 12px 0; }

/* Status badges */
.sd-badge { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.sd-badge-active    { background: #d4edda; color: #155724; }
.sd-badge-submitted { background: #cce4ff; color: #004a99; }
.sd-badge-closed    { background: #f0f0f0; color: #666; }

/* Detail view */
.sd-detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.sd-detail-desc   { color: #555; font-size: .9rem; margin: 6px 0 8px; }
.sd-detail-actions{ flex-shrink: 0; }

/* Thumbnail grid */
.sd-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}
.sd-thumb-card {
    border: 1.5px solid #e0e6ed; border-radius: 8px; overflow: hidden;
    background: #f8f9fb; transition: box-shadow .2s;
}
.sd-thumb-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.sd-thumb-preview { width: 100%; aspect-ratio: 1; overflow: hidden; background: #edf0f3; }
.sd-thumb-preview img  { width: 100%; height: 100%; object-fit: cover; display: block; }
.sd-thumb-preview video{ width: 100%; height: 100%; object-fit: cover; display: block; }
.sd-file-icon {
    width: 100%; height: 100%; display: flex; align-items: center;
    justify-content: center; flex-direction: column; gap: 6px;
}
.sd-ext-badge {
    background: #0073e6; color: #fff; border-radius: 4px;
    padding: 4px 10px; font-size: .8rem; font-weight: 700; text-transform: uppercase;
}
.sd-thumb-info    { padding: 8px 10px; }
.sd-thumb-name    { font-size: .78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.sd-thumb-meta    { font-size: .71rem; color: #888; margin-bottom: 7px; }
.sd-thumb-actions { display: flex; gap: 5px; }

/* Login form (shortcode state) */
.sd-wrap .sd-card { max-width: 440px; margin: 40px auto; }
.sd-logo { text-align: center; margin-bottom: 16px; }
.sd-logo img { max-height: 70px; }
.sd-card label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.sd-card input[type="email"] {
    display: block; width: 100%; padding: 10px 13px;
    border: 1.5px solid #d0d7de; border-radius: 6px;
    font-size: .95rem; margin-bottom: 14px;
}
.sd-card .sd-btn-primary { width: 100%; padding: 12px; font-size: 1rem; }

@media (max-width: 500px) {
    .sd-field-row { grid-template-columns: 1fr; }
    .sd-thumbnail-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .sd-inv-actions { width: 100%; }
}

/* Section labels in create form */
.sd-section-label {
    font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: #888; padding: 6px 0 2px;
    border-top: 1px solid #eef0f3; margin-top: 4px;
}

/* Checkbox label */
.sd-checkbox-label {
    display: flex; align-items: flex-start; gap: 9px;
    font-weight: 400; font-size: .9rem; cursor: pointer; color: #333;
}
.sd-checkbox-label input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }

/* Radio group */
.sd-radio-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.sd-radio-label {
    display: flex; align-items: center; gap: 8px;
    font-weight: 400; font-size: .9rem; cursor: pointer; color: #333;
}
.sd-radio-label input[type="radio"] { flex-shrink: 0; }

/* ── Redesigned invitation list cards ────────────────────────── */
.sd-inv-card { padding: 20px 0 8px; }
.sd-inv-card h2 { padding: 0 20px; margin-bottom: 12px; }

.sd-inv-list { display: flex; flex-direction: column; }

.sd-inv-row2 {
    display: flex; align-items: stretch;
    border-bottom: 1px solid #eef0f3;
    transition: background .15s;
    min-height: 72px;
}
.sd-inv-row2:last-child { border-bottom: none; }
.sd-inv-row2:hover { background: #fafbfc; }

/* Status stripe */
.sd-inv-stripe {
    width: 5px; flex-shrink: 0; border-radius: 0;
}
.sd-stripe-active    { background: #28a745; }
.sd-stripe-submitted { background: #0073e6; }
.sd-stripe-closed    { background: #ccc; }

/* Body */
.sd-inv-body {
    flex: 1; min-width: 0;
    padding: 14px 16px;
    display: flex; flex-direction: column; gap: 5px;
}

.sd-inv-header-row {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.sd-inv-title2 {
    font-size: 1rem; font-weight: 700; color: #1a1a2e;
    text-decoration: none; line-height: 1.3;
}
.sd-inv-title2:hover { color: #0073e6; }

.sd-inv-meta2 {
    font-size: .8rem; color: #777;
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
}
.sd-meta-sep { color: #ccc; }

.sd-inv-url2 {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap; margin-top: 2px;
}
.sd-inv-url-text {
    font-size: .75rem; color: #666; background: #f3f4f6;
    padding: 3px 8px; border-radius: 4px; font-family: monospace;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 420px; display: inline-block;
}

/* Actions column */
.sd-inv-actions2 {
    display: flex; flex-direction: column;
    gap: 5px; padding: 12px 14px;
    justify-content: center; flex-shrink: 0;
    align-items: stretch; min-width: 110px;
}
.sd-inv-actions2 .sd-btn {
    text-align: center; white-space: nowrap;
    font-size: .78rem; padding: 5px 10px;
}

@media (max-width: 560px) {
    .sd-inv-row2 { flex-wrap: wrap; }
    .sd-inv-actions2 {
        flex-direction: row; flex-wrap: wrap;
        width: 100%; padding: 8px 14px 12px;
        border-top: 1px solid #eef0f3;
        min-width: unset;
    }
    .sd-inv-url-text { max-width: 200px; }
}
