/* =============================================
   PixelGet — Retro Metallic UI
   ============================================= */

:root {
    --bg-base:        #1a1a1c;
    --bg-panel:       #222224;
    --bg-elevated:    #2a2a2e;
    --bg-hover:       #303036;
    --border:         #3a3a40;
    --border-light:   #48484f;
    --text-primary:   #d4d4d8;
    --text-secondary: #8a8a92;
    --text-dim:       #56565e;
    --accent:         #9ca3af;
    --accent-bright:  #e2e8f0;
    --success:        #6b8f6b;
    --error:          #8f5a5a;
    --warning:        #8f7a4a;
    --radius:         6px;
    --radius-lg:      10px;
    --font-mono:      'Courier New', 'Consolas', monospace;
    --font-sans:      -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 24px 16px;
}

/* ---- Layout ---- */
.container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---- Header ---- */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    fill: none;
    stroke: var(--text-secondary);
    stroke-width: 1.5;
}

.logo-icon rect {
    fill: var(--bg-elevated);
    stroke: var(--border-light);
}

h1 {
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 2px;
    color: var(--accent-bright);
    text-transform: uppercase;
}

.subtitle {
    font-size: 13px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

/* ---- Grid ---- */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .subtitle {
        display: none;
    }
}

/* ---- Panel ---- */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

.panel-header svg {
    fill: none;
    stroke: var(--text-dim);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.header-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

/* ---- Textarea ---- */
textarea {
    flex: 1;
    width: 100%;
    min-height: 180px;
    background: transparent;
    border: none;
    padding: 14px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    resize: vertical;
    line-height: 1.7;
}

textarea:focus {
    outline: none;
}

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

/* ---- Buttons ---- */
.panel-actions,
.output-actions {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    background: var(--bg-elevated);
}

button {
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: var(--radius);
    transition: background 0.15s, opacity 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
}

button svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--accent-bright);
    color: #1a1a1c;
}

.btn-primary:hover {
    background: #fff;
}

.btn-primary:active {
    opacity: 0.85;
}

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

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

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.icon-btn {
    background: transparent;
    color: var(--text-dim);
    padding: 5px 7px;
    border-radius: var(--radius);
}

.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ---- Output Container ---- */
.output-container {
    flex: 1;
    min-height: 180px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---- Link Card ---- */
.link-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.link-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
}

.link-card-url {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-bright);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.link-card-url:hover {
    text-decoration: underline;
}

.link-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.status-checking {
    color: var(--warning);
    background: rgba(143, 122, 74, 0.12);
    border: 1px solid rgba(143, 122, 74, 0.25);
}

.status-ok {
    color: var(--success);
    background: rgba(107, 143, 107, 0.12);
    border: 1px solid rgba(107, 143, 107, 0.25);
}

.status-error {
    color: var(--error);
    background: rgba(143, 90, 90, 0.12);
    border: 1px solid rgba(143, 90, 90, 0.25);
}

.link-actions {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--border);
}

.link-action-btn {
    flex: 1;
    padding: 7px 10px;
    font-size: 11px;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 0;
    border-right: 1px solid var(--border);
    letter-spacing: 0.3px;
}

.link-action-btn:last-child {
    border-right: none;
}

.link-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* QR Code */
.qr-wrapper {
    display: none;
    justify-content: center;
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-base);
}

.qr-wrapper.visible {
    display: flex;
}

.qr-wrapper canvas {
    border-radius: 4px;
    border: 4px solid var(--bg-panel);
}

/* ---- Empty State ---- */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-dim);
    text-align: center;
    padding: 24px;
}

.empty-state svg {
    fill: none;
    stroke: var(--text-dim);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    font-weight: 500;
}

.empty-state small {
    font-size: 12px;
    opacity: 0.7;
}

.empty-state.small {
    padding: 16px;
    font-size: 12px;
}

/* ---- History ---- */
.history-panel {
    max-height: 200px;
}

.history-container {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    background: var(--bg-panel);
    cursor: pointer;
    transition: background 0.1s;
    font-size: 12px;
}

.history-item:hover {
    background: var(--bg-hover);
}

.history-item-time {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    white-space: nowrap;
}

.history-item-urls {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.history-item-count {
    color: var(--text-dim);
    font-size: 11px;
    white-space: nowrap;
}

/* ---- Status Bar ---- */
.status-bar {
    padding: 9px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    font-family: var(--font-mono);
    border: 1px solid var(--border);
}

.status-bar.ok {
    background: rgba(107, 143, 107, 0.08);
    border-color: rgba(107, 143, 107, 0.25);
    color: var(--success);
}

.status-bar.err {
    background: rgba(143, 90, 90, 0.08);
    border-color: rgba(143, 90, 90, 0.25);
    color: var(--error);
}

.hidden {
    display: none !important;
}

/* ---- Footer ---- */
.footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.footer strong {
    color: var(--text-secondary);
}

.separator {
    opacity: 0.3;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}
