/* Premium Minimal Slate/Zinc Theme - High Fidelity Aesthetic */

:root {
    --bg-color: #030305;
    --card-bg: rgba(9, 9, 12, 0.65);
    --border-color: rgba(255, 255, 255, 0.04);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #4b4b52;
    --accent-color: #38bdf8;
    --success-color: #10b981;
    --error-color: #ef4444;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "JetBrains Mono", monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(1200px circle at 50% -20%, rgba(124, 58, 237, 0.05) 0%, rgba(99, 102, 241, 0.02) 60%, transparent 100%),
        radial-gradient(800px circle at 90% 90%, rgba(56, 189, 248, 0.01) 0%, transparent 100%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* Subtle graphic design tech grid overlay */
.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-size: 32px 32px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.005) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.005) 1px, transparent 1px);
}

/* Premium floating blur light circles in the background */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.07;
    z-index: -2;
    pointer-events: none;
    animation: float 25s infinite alternate ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background-color: #7c3aed;
    top: -10%;
    left: 5%;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background-color: #0284c7;
    bottom: -5%;
    right: 5%;
    animation-delay: -12s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-40px, 40px) scale(1.1); }
}

.app-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: contentFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.card {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 
        0 40px 80px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.01);
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow: hidden;
}

/* Interactive radial lighting border highlight on mousemove */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: radial-gradient(
        400px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
        rgba(255, 255, 255, 0.08),
        transparent 50%
    );
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 5;
}

/* Card top glowing progress line */
.progress-bar-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.01);
    z-index: 100;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--accent-color), #ffffff, var(--accent-color));
    box-shadow: 0 0 8px var(--accent-color);
    transition: width 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Card Header */
.card-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.header-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.logo-icon {
    width: 15px;
    height: 15px;
    color: #ffffff;
    opacity: 0.9;
    animation: logoRotate 6s ease-in-out infinite;
}

@keyframes logoRotate {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.logo-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.1em;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 3px 8px;
    border-radius: 100px;
}

.status-dot {
    width: 4px;
    height: 4px;
    background-color: var(--success-color);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--success-color);
    animation: indicatorPulse 2s infinite ease-in-out;
}

.status-lbl {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
}

.card-header h1 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.45;
    font-weight: 400;
}

/* Input group */
.input-group {
    display: flex;
    flex-direction: column;
}

.drop-zone {
    position: relative;
    width: 100%;
}

textarea {
    width: 100%;
    height: 120px;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 0.78125rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

textarea:focus {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.04);
}

.drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 8, 0.98);
    border: 1px dashed var(--border-hover);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.drop-zone.dragover .drop-overlay {
    opacity: 1;
}

.drop-msg {
    font-size: 0.8125rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Primary Button */
.primary-btn {
    width: 100%;
    height: 42px;
    background-color: #fafafa;
    color: #09090b;
    border: none;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s, transform 0.1s;
    outline: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.primary-btn:hover {
    background-color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.08);
}

.primary-btn:active {
    transform: scale(0.99);
}

.primary-btn:disabled {
    background-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-arrow {
    display: inline-block;
    margin-left: 4px;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.primary-btn:hover .btn-arrow {
    transform: translateX(3px);
}

/* Spinner */
.loading-state {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.78125rem;
    color: #09090b;
}

.spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: #09090b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Activity Logs Console */
.log-console {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: var(--font-mono);
    font-size: 0.71875rem;
    color: var(--text-secondary);
    max-height: 70px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.log-line {
    opacity: 0.85;
}
.log-line.info { color: var(--text-secondary); }
.log-line.success { color: var(--success-color); }
.log-line.error { color: var(--error-color); }

/* Output Deck */
.output-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    animation: itemFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.output-header h2 {
    font-size: 0.71875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bulk-actions {
    display: flex;
    gap: 6px;
}

.secondary-btn {
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 5px 12px;
    font-family: var(--font-sans);
    font-size: 0.71875rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
    outline: none;
}

.secondary-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.links-panel {
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* File list row item */
.node-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    animation: itemSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.node-row:hover {
    background-color: rgba(255, 255, 255, 0.025);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.node-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    margin-right: 12px;
}

.node-title-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-indicator {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--accent-color);
    box-shadow: 0 0 5px var(--accent-color);
    flex-shrink: 0;
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.file-svg {
    width: 12px;
    height: 12px;
    stroke-width: 2.2px;
}

.file-name-link {
    font-size: 0.78125rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.file-name-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.file-size {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.04);
    padding: 0px 4px;
    border-radius: 3px;
    flex-shrink: 0;
}

.row-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Icon Action Buttons */
.action-btn {
    width: 26px;
    height: 26px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
    outline: none;
}

.action-btn:hover {
    border-color: var(--border-hover);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn.copy-btn.success {
    color: var(--success-color);
    border-color: rgba(16, 185, 129, 0.25);
    background-color: rgba(16, 185, 129, 0.04);
}

.action-btn .icon {
    width: 12px;
    height: 12px;
    stroke-width: 2.2px;
}

/* Toast System */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 1000;
}

.toast {
    background-color: rgba(15, 15, 18, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    padding: 8px 12px;
    font-size: 0.71875rem;
    border-radius: 6px;
    min-width: 180px;
    max-width: 300px;
    animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    display: flex;
    align-items: center;
    color: var(--text-primary);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.15);
    color: var(--error-color);
}

.toast.success {
    border-color: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

/* Animations */
@keyframes toastIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-6px); }
}

@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes itemFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes itemSlideIn {
    from { opacity: 0; transform: translateX(-4px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes indicatorPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* App Footer Styling */
.app-footer {
    text-align: center;
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 8px 0;
    opacity: 0.6;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-footer:hover {
    opacity: 0.95;
    color: var(--text-secondary);
}