/* ===================================================================
   LINK FASTADS — SCHEDULE MODULE STYLES (v1.0)
   prefix .sched-* เพื่อไม่ชนกับ class เดิม
   =================================================================== */

/* ── Schedule button (ในแต่ละ card) ── */
.sched-img-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    margin-top: 6px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.18s;
}
.sched-img-btn:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    box-shadow: 0 3px 10px rgba(243,156,18,0.35);
}
.sched-img-btn i { font-size: 0.85rem; }

/* ── Modal shell ── */
.sched-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 25, 40, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 20px;
    overflow-y: auto;
}
.sched-modal-content {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 580px;
    overflow: hidden;
    animation: schedSlideIn 0.25s ease-out;
}
@keyframes schedSlideIn {
    from { transform: translateY(-15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.sched-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: linear-gradient(135deg, #e67e22, #f39c12);
    color: #fff;
}
.sched-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sched-close-btn {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    border-radius: 7px;
    cursor: pointer;
}
.sched-close-btn:hover { background: rgba(255,255,255,0.3); }

.sched-modal-body { padding: 20px 22px; }

.sched-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid #e4e9f0;
    background: #f9fbfc;
}

/* ── Target info ── */
.sched-target-info {
    background: #f4f7fb;
    border: 1px solid #e4e9f0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 0.85rem;
}
.sched-target-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}
.sched-target-lbl { color: #7f8c9b; font-size: 0.8rem; }
.sched-target-val { color: #1a2332; font-weight: 500; }
.sched-target-val code {
    background: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #e4e9f0;
    font-size: 0.78rem;
    color: #1a6fa8;
}

/* ── Steps ── */
.sched-step { margin-bottom: 20px; }
.sched-step:last-child { margin-bottom: 0; }
.sched-step-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a2332;
    margin-bottom: 10px;
}
.sched-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #e67e22;
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ── Drop zone ── */
.sched-drop-zone {
    border: 2px dashed #c0cad6;
    border-radius: 10px;
    padding: 24px 16px;
    text-align: center;
    background: #f9fbfd;
    cursor: pointer;
    transition: all 0.18s;
}
.sched-drop-zone:hover, .sched-drop-zone.drag-over {
    border-color: #e67e22;
    background: #fef9f3;
}
.sched-drop-icon {
    font-size: 1.8rem;
    color: #e67e22;
    margin-bottom: 8px;
}
.sched-drop-text {
    font-size: 0.9rem;
    color: #2c3e50;
    margin-bottom: 4px;
}
.sched-drop-text b { color: #e67e22; }
.sched-drop-hint { font-size: 0.75rem; color: #7f8c9b; }

.sched-file-info {
    margin-top: 10px;
    padding: 12px 14px;
    background: #eaf7ed;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1e7e34;
}
.sched-muted { color: #7f8c9b; font-size: 0.78rem; }

/* ── File preview ── */
.sched-preview-wrap {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    width: 100%;
}
.sched-preview-img {
    width: 120px;
    min-width: 120px;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #d5dbe4;
    background: #f0f3f7;
    flex-shrink: 0;
}
.sched-preview-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sched-preview-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.sched-preview-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    word-break: break-all;
}
.sched-preview-details {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #5d6d7e;
    flex-wrap: wrap;
}

/* ── DateTime grid ── */
.sched-datetime-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}
.sched-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.sched-field label {
    font-size: 0.78rem;
    font-weight: 500;
    color: #555;
}
.sched-field input[type="date"],
.sched-field input[type="time"] {
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d5dbe4;
    border-radius: 7px;
    font-size: 0.88rem;
    background: #f9fbfd;
    outline: none;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.sched-field input:focus {
    border-color: #e67e22;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(230,126,34,0.12);
}

/* ── Quick time buttons ── */
.sched-quick-times {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.sched-quick-btn {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #d5dbe4;
    border-radius: 16px;
    font-size: 0.78rem;
    color: #5d6d7e;
    cursor: pointer;
    transition: all 0.15s;
}
.sched-quick-btn:hover {
    background: #fef9f3;
    border-color: #e67e22;
    color: #e67e22;
}

/* ── Time preview ── */
.sched-time-preview {
    padding: 10px 14px;
    background: #eaf4fb;
    border: 1px solid #aed6f1;
    border-radius: 7px;
    color: #1a5276;
    font-size: 0.85rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sched-time-preview b { color: #1a2332; }
.sched-rel {
    color: #7f8c9b;
    font-size: 0.78rem;
    margin-left: 4px;
}
.sched-warn {
    color: #c0392b;
    background: #fdecea;
    border: 1px solid #f5b7b1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: inline-block;
}

/* ── Status / Loading ── */
.sched-status {
    margin-top: 14px;
}
.sched-uploading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f9fbfd;
    border: 1px solid #e4e9f0;
    border-radius: 7px;
    color: #5d6d7e;
    font-size: 0.88rem;
}
.sched-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e4e9f0;
    border-top-color: #e67e22;
    border-radius: 50%;
    animation: schedSpin 0.7s linear infinite;
}
@keyframes schedSpin { to { transform: rotate(360deg); } }
.sched-error {
    padding: 12px 16px;
    background: #fdecea;
    border: 1px solid #f5b7b1;
    border-radius: 7px;
    color: #a93226;
    font-size: 0.88rem;
    font-family: monospace;
}

/* ── Buttons ── */
.sched-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.sched-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sched-btn:active:not(:disabled) { transform: scale(0.97); }
.sched-btn-primary {
    background: #e67e22;
    color: #fff;
    border-color: #d35400;
}
.sched-btn-primary:hover:not(:disabled) {
    background: #d35400;
    box-shadow: 0 3px 10px rgba(230,126,34,0.3);
}
.sched-btn-ghost {
    background: #fff;
    color: #5d6d7e;
    border-color: #d5dbe4;
}
.sched-btn-ghost:hover:not(:disabled) {
    background: #ecf0f1;
    color: #2c3e50;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .sched-modal { padding: 12px; }
    .sched-modal-body { padding: 16px; }
    .sched-datetime-grid { grid-template-columns: 1fr; }
    .sched-modal-footer { flex-direction: column-reverse; }
    .sched-modal-footer .sched-btn { width: 100%; justify-content: center; }
}
