﻿/* ============================================================
   DASHBOARD — Design System v2  "Operator Terminal"
   ============================================================ */


/* ====================
   1. BASE
   ==================== */

:root {
    --bg:       #0a0f14;
    --surface:  #0d1520;
    --raised:   #111c2a;
    --hover:    #162535;
    --border:   rgba(255, 255, 255, 0.07);
    --border-m: rgba(255, 255, 255, 0.12);
    --text:     #e8edf2;
    --text-2:   #7a8899;
    --text-3:   #3d4f60;
    --accent:   #22d3ee;
    --accent-d: rgba(34, 211, 238, 0.12);
    --blue:     #3b82f6;
    --blue-d:   rgba(59, 130, 246, 0.12);
    --green:    #4ade80;
    --green-d:  rgba(74, 222, 128, 0.12);
    --red:      #f87171;
    --red-d:    rgba(248, 113, 113, 0.08);
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
}


/* ====================
   2. SCROLLBAR
   ==================== */

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1e2d3d; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.4); }


/* ====================
   3. FORM — SELECT ARROW (cyan)
   ==================== */

select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2322d3ee' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}


/* ====================
   4. FIELD INPUT — unified focus glow
   ==================== */

.field-input {
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field-input:focus {
    outline: none;
    border-color: rgba(34, 211, 238, 0.35) !important;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.07);
}

.field-input.pixel-field:focus {
    border-color: rgba(59, 130, 246, 0.35) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.07);
}


/* ====================
   5. CARD — left accent border
   ==================== */

.card-item {
    position: relative;
}

.card-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.card-item:hover::before { opacity: 0.7; }


/* ====================
   6. SECTION LABEL
   ==================== */

.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}


/* ====================
   7. IMAGE GALLERY — DRAG & DROP
   ==================== */

.dragging {
    opacity: 0.35;
    border: 1px dashed var(--accent) !important;
    transform: scale(0.92);
}

#imagePreviewList li { cursor: grab; transition: all 0.15s ease; }
#imagePreviewList li:active { cursor: grabbing; }


/* ====================
   8. STATUS DOT
   ==================== */

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
    50%       { box-shadow: 0 0 0 5px rgba(74, 222, 128, 0); }
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    animation: pulse-green 2.5s ease-in-out infinite;
}


/* ====================
   9. TOAST
   ==================== */

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--raised);
    border: 1px solid var(--border-m);
    color: var(--text);
    padding: 13px 18px;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    animation: toast-slide 0.22s ease-out;
}

@keyframes toast-slide {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red);   }


/* ====================
   10. GENERATE BUTTON GLOW
   ==================== */

.btn-generate {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.1s;
}

.btn-generate:hover {
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.35);
    transform: translateY(-1px);
}

.btn-generate:active { transform: scale(0.98); }



/* ====================
   1. BASE
   ==================== */

body {
    font-family: 'Inter', sans-serif;
    background-color: #0f172a;
    color: #e2e8f0;
}


/* ====================
   2. SCROLLBAR
   ==================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}


/* ====================
   3. FORM — SELECT ARROW
   ==================== */

select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}


/* ====================
   4. IMAGE GALLERY — DRAG & DROP
   ==================== */

.dragging {
    opacity: 0.5;
    border: 2px dashed #6366f1;
    transform: scale(0.95);
}

#imagePreviewList li {
    cursor: grab;
    transition: all 0.2s ease;
}

#imagePreviewList li:active {
    cursor: grabbing;
}


/* ====================
   5. TOAST NOTIFICATIONS
   ==================== */

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.toast.error {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

/* Cards grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    align-items: start;
}

/* ========================
   CARD
   ======================== */

.lcard {
    background: #0d1520;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.lcard:hover {
    border-color: rgba(34,211,238,0.22);
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

/* card header */
.lcard-head {
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.lcard-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}
.lcard-name {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s;
}
.lcard:hover .lcard-name { color: #22d3ee; }
.lcard-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #3d4f60;
    white-space: nowrap;
    flex-shrink: 0;
}
.lcard-url {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #4a5568;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}
.lcard-url:hover { color: #22d3ee; }
.lcard-missing {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(248,113,113,0.75);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* fields section */
.lcard-fields {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.lcard-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lcard-field-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    font-size: 11px;
}
.lcard-input {
    flex: 1;
    min-width: 0;
    background: #0a0f14;
    border: 1px solid rgba(255,255,255,0.07);
    color: #e8edf2;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 7px;
    text-align: center;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.lcard-input:focus {
    border-color: rgba(34,211,238,0.4);
    box-shadow: 0 0 0 3px rgba(34,211,238,0.07);
}
.lcard-input.pixel:focus {
    border-color: rgba(59,130,246,0.4);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.07);
}
.lcard-input::placeholder { color: #2a3a4a; }
.lcard-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    transition: background 0.15s;
}
.lcard-btn.cyan  { background: rgba(34,211,238,0.08);  color: #22d3ee; }
.lcard-btn.cyan:hover  { background: rgba(34,211,238,0.2); }
.lcard-btn.blue  { background: rgba(59,130,246,0.08);  color: #3b82f6; }
.lcard-btn.blue:hover  { background: rgba(59,130,246,0.2); }

/* footer actions */
.lcard-actions {
    display: flex;
    gap: 4px;
    padding: 8px 10px;
    margin-top: auto;
}
.lcard-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 11px;
    padding: 7px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    background: rgba(255,255,255,0.02);
    border: none;
    text-decoration: none;
    color: #7a8899;
    font-family: 'DM Sans', sans-serif;
}
.lcard-action:hover { background: rgba(255,255,255,0.06); color: #e8edf2; }
.lcard-action.del { color: #3d4f60; background: transparent; }
.lcard-action.del:hover { background: rgba(248,113,113,0.07); color: #f87171; }
.lcard-action form { flex: 1; }

