/* YEET — Styles */

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Theme Variables */
:root {
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.2);
    --transition: 0.2s ease;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --bg-input: #1a1a25;
    --bg-input-focus: #1f1f2c;
    --border: #2a2a3a;
    --border-focus: #6c5ce7;
    --text: #e8e8f0;
    --text-secondary: #8888a0;
    --text-placeholder: #555568;
    --primary: #6c5ce7;
    --primary-hover: #7d6ff0;
    --primary-active: #5b4bd5;
    --success: #00d68f;
    --error: #ff6b6b;
    --error-bg: rgba(255, 107, 107, 0.1);
    --icon-sun: none;
    --icon-moon: inline;
    --bg-history: #16161f;
    --border-history: #222233;
}

/* Light Theme */
[data-theme="light"] {
    --bg: #f0f0f5;
    --bg-card: #ffffff;
    --bg-input: #f5f5fa;
    --bg-input-focus: #eeeeF5;
    --border: #e0e0e8;
    --border-focus: #6c5ce7;
    --text: #1a1a2e;
    --text-secondary: #666680;
    --text-placeholder: #9999aa;
    --primary: #6c5ce7;
    --primary-hover: #7d6ff0;
    --primary-active: #5b4bd5;
    --success: #00b377;
    --error: #e55555;
    --error-bg: rgba(229, 85, 85, 0.08);
    --icon-sun: inline;
    --icon-moon: none;
    --bg-history: #f8f8fc;
    --border-history: #e8e8f0;
}

/* Body */
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background var(--transition), color var(--transition);
}

/* Screens */
.screen {
    display: none;
    width: 100%;
    max-width: 440px;
}

.screen.active {
    display: block;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow);
    transition: background var(--transition), border var(--transition);
}

/* Logo */
.logo {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -2px;
    text-align: center;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo.small {
    font-size: 1.5rem;
    letter-spacing: -1px;
}

/* Tagline */
.tagline {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 8px;
    margin-bottom: 32px;
    font-size: 0.9rem;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

/* Form */
form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Input Groups */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: lowercase;
}

.input-group .optional {
    font-weight: 400;
    opacity: 0.6;
}

/* Inputs */
input[type="text"],
input[type="password"],
textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 1rem;
    font-family: var(--font);
    color: var(--text);
    transition: all var(--transition);
    outline: none;
    resize: vertical;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-placeholder);
}

/* Character Count */
.char-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 2px;
}

/* File Drop Zone */
.file-drop-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.05);
}

.file-drop-zone.has-file {
    border-style: solid;
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.05);
    padding: 12px 16px;
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.file-icon {
    font-size: 1.5rem;
}

.file-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.file-preview.hidden {
    display: none;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.remove-file-btn {
    background: var(--error-bg);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--error);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all var(--transition);
}

.remove-file-btn:hover {
    background: var(--error);
    color: white;
}

/* Shortcut Hint */
.shortcut-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0.6;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    background: var(--primary-active);
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-input);
    color: var(--text);
}

/* Actions Row */
.actions {
    display: flex;
    gap: 12px;
}

.actions .btn-secondary {
    flex: 0 0 auto;
}

.actions .btn-primary {
    flex: 1;
}

/* Icon Button */
.icon-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1.1rem;
}

.icon-btn:hover {
    background: var(--bg-input-focus);
    border-color: var(--border-focus);
}

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: inline; }
[data-theme="light"] .icon-sun { display: inline; }
[data-theme="light"] .icon-moon { display: none; }

/* Status */
.status {
    margin-top: 20px;
    text-align: center;
    padding: 16px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.status.hidden {
    display: none;
}

.status-msg {
    font-size: 0.95rem;
    font-weight: 600;
}

.status-msg.success {
    color: var(--success);
}

.status-msg.error {
    color: var(--error);
}

.status-msg.hidden {
    display: none;
}

/* Error */
.error {
    color: var(--error);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 12px;
    padding: 10px;
    background: var(--error-bg);
    border-radius: var(--radius-sm);
}

.error.hidden {
    display: none;
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}

.spinner.hidden {
    display: none;
}

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

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* History Section */
.history-section {
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.history-section.hidden {
    display: none;
}

.history-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    transition: color var(--transition);
}

.history-toggle:hover {
    color: var(--text);
}

.history-toggle::after {
    content: '▸';
    transition: transform var(--transition);
}

.history-toggle.open::after {
    transform: rotate(90deg);
}

.history-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.history-list.hidden {
    display: none;
}

.history-item {
    background: var(--bg-history);
    border: 1px solid var(--border-history);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.history-item:hover {
    border-color: var(--primary);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.history-device {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

.history-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.history-text {
    font-size: 0.85rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-file {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Display Value (read-only name display) */
.display-value {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 1rem;
    font-family: var(--font);
    color: var(--text);
    font-weight: 600;
}

/* Input Hint */
.input-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* User Label */
.user-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 8px;
}

/* Link Instructions */
.link-instructions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.link-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.link-step-num {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Link Code Box */
.link-code-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--bg-input);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 20px;
}

.link-code {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: monospace;
}

/* Bottom Link */
.bottom-link {
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bottom-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.bottom-link a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
    .card {
        padding: 32px 20px;
    }

    .logo {
        font-size: 2.5rem;
    }
}
