/* OpsKit — Light Pixel Art Theme */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=ZCOOL+XiaoWei&display=swap');

/* Override Tailwind defaults for pixel look */
* {
    border-radius: 0 !important;
}

body {
    font-family: 'VT323', 'ZCOOL XiaoWei', monospace;
    font-size: 18px;
    background-color: #f5f0e8;
    color: #3a3a4a;
    image-rendering: pixelated;
}

/* Chinese text fallback */
:lang(zh-hans) body,
:lang(zh) body {
    font-family: 'ZCOOL XiaoWei', 'VT323', monospace;
}

/* Pixel border utility */
.pixel-border {
    border: 3px solid #e8833a;
    box-shadow:
        3px 3px 0 #d4722e,
        inset 0 0 0 1px rgba(232, 131, 58, 0.1);
}

.pixel-border-dim {
    border: 3px solid #c8c0b0;
    box-shadow: 3px 3px 0 #b8b0a0;
}

/* Navbar */
nav {
    background: #fff8ee !important;
    border-bottom: 3px solid #e8833a !important;
    border-color: #e8833a !important;
    box-shadow: 0 3px 0 rgba(232, 131, 58, 0.3);
}

nav a, nav button {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px !important;
    letter-spacing: 0.5px;
    color: #5a4a3a !important;
}

/* Brand logo */
.brand-logo {
    color: #e8833a !important;
    font-family: 'Press Start 2P', cursive;
    font-size: 14px !important;
    text-shadow: 0 0 10px rgba(232, 131, 58, 0.3);
}

.brand-logo:hover {
    text-shadow: 0 0 20px rgba(232, 131, 58, 0.5);
}

/* Headings */
h1, h2, h3 {
    font-family: 'Press Start 2P', 'ZCOOL XiaoWei', cursive;
    color: #e8833a;
    text-shadow: 2px 2px 0 #f0e8d8;
    line-height: 1.8;
}

h1 { font-size: 16px; }
h2 { font-size: 12px; }

/* Links */
a {
    color: #e8833a;
    text-decoration: none;
}
a:hover {
    color: #d4722e;
    text-shadow: 0 0 8px rgba(232, 131, 58, 0.4);
}

/* Tool cards */
.tool-card {
    background: #fff8ee;
    border: 3px solid #c8c0b0;
    box-shadow: 4px 4px 0 #d8d0c0;
    transition: all 0.1s ease;
    padding: 24px;
}

.tool-card:hover {
    border-color: #e8833a;
    box-shadow: 4px 4px 0 #e8833a, 0 0 15px rgba(232, 131, 58, 0.15);
    transform: translate(-2px, -2px);
}

.tool-card h2 {
    color: #e8833a;
    margin-bottom: 8px;
}

.tool-card p {
    color: #7a7a8a;
    font-family: 'VT323', 'ZCOOL XiaoWei', monospace;
    font-size: 18px;
}

/* Textareas */
textarea {
    font-family: 'VT323', 'ZCOOL XiaoWei', monospace !important;
    font-size: 18px !important;
    background: #fffdf8 !important;
    color: #3a3a4a !important;
    border: 3px solid #c8c0b0 !important;
    box-shadow: inset 2px 2px 0 #f0e8d8;
    padding: 12px !important;
}

textarea:focus {
    border-color: #e8833a !important;
    box-shadow: inset 2px 2px 0 #f0e8d8, 0 0 10px rgba(232, 131, 58, 0.2);
    outline: none !important;
    ring: none !important;
}

textarea[readonly] {
    background: #f5f0e8 !important;
    color: #c06020 !important;
}

/* Input placeholder */
textarea::placeholder {
    color: #b0a898 !important;
}

/* Buttons */
button, .btn-pixel {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    background: #fff8ee;
    color: #e8833a;
    border: 3px solid #e8833a;
    box-shadow: 4px 4px 0 #d4722e;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.05s ease;
    letter-spacing: 0.5px;
}

button:hover {
    background: #e8833a;
    color: #fff8ee;
    box-shadow: 2px 2px 0 #d4722e;
    transform: translate(2px, 2px);
}

button:active {
    box-shadow: none;
    transform: translate(4px, 4px);
}

/* Primary button variant */
.btn-primary {
    background: #e8833a;
    color: #fff8ee;
    border-color: #e8833a;
    box-shadow: 4px 4px 0 #d4722e;
}

.btn-primary:hover {
    background: #d4722e;
    border-color: #d4722e;
}

/* Secondary button / copy */
.btn-secondary {
    background: transparent;
    color: #e8833a;
    border: 2px solid #e8833a;
    box-shadow: 2px 2px 0 #d4722e;
    font-size: 8px;
    padding: 6px 12px;
}

.btn-secondary:hover {
    background: #e8833a;
    color: #fff8ee;
}

/* Select dropdowns */
select {
    font-family: 'VT323', 'ZCOOL XiaoWei', monospace;
    font-size: 18px;
    background: #fff8ee;
    color: #3a3a4a;
    border: 3px solid #c8c0b0;
    box-shadow: 3px 3px 0 #d8d0c0;
    padding: 8px;
    cursor: pointer;
}

select:focus {
    border-color: #e8833a;
    outline: none;
}

/* Checkbox pixel style */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #fff8ee;
    border: 3px solid #c8c0b0;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

input[type="checkbox"]:checked {
    background: #e8833a;
    border-color: #e8833a;
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 8px;
    height: 8px;
    background: #fff8ee;
}

/* Number input */
input[type="number"], input[type="text"] {
    font-family: 'VT323', 'ZCOOL XiaoWei', monospace;
    font-size: 18px;
    background: #fff8ee;
    color: #3a3a4a;
    border: 3px solid #c8c0b0;
    box-shadow: 3px 3px 0 #d8d0c0;
    padding: 8px;
}

input[type="number"]:focus, input[type="text"]:focus {
    border-color: #e8833a;
    outline: none;
}

input[type="radio"] {
    accent-color: #e8833a;
}

/* Labels */
label {
    font-family: 'VT323', 'ZCOOL XiaoWei', monospace;
    font-size: 18px;
    color: #7a7a8a;
}

/* Error message */
.error-msg {
    color: #d44 !important;
    font-family: 'Press Start 2P', cursive;
    font-size: 9px;
}

/* FAQ accordion */
.faq-item {
    background: #fff8ee;
    border: 3px solid #c8c0b0;
    box-shadow: 3px 3px 0 #d8d0c0;
}

.faq-item button {
    font-family: 'VT323', 'ZCOOL XiaoWei', monospace;
    font-size: 18px;
    color: #3a3a4a;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 12px 16px;
    width: 100%;
    text-align: left;
}

.faq-item button:hover {
    background: #f0e8d8;
    color: #e8833a;
    transform: none;
    box-shadow: none;
}

.faq-answer {
    color: #7a7a8a;
    font-size: 18px;
    padding: 0 16px 12px;
}

/* Footer */
footer {
    background: #fff8ee !important;
    border-top: 3px solid #c8c0b0 !important;
    border-color: #c8c0b0 !important;
}

footer * {
    font-family: 'VT323', 'ZCOOL XiaoWei', monospace;
    font-size: 16px;
    color: #a09888 !important;
}

/* Language dropdown */
#lang-dropdown {
    background: #fff8ee;
    border: 3px solid #c8c0b0;
    box-shadow: 4px 4px 0 #d8d0c0;
}

#lang-dropdown button {
    font-family: 'VT323', 'ZCOOL XiaoWei', monospace;
    font-size: 16px;
    border: none;
    box-shadow: none;
    padding: 8px 16px;
    color: #7a7a8a !important;
}

#lang-dropdown button:hover {
    background: #f0e8d8;
    color: #e8833a !important;
    transform: none;
    box-shadow: none;
}

/* Scanline overlay effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.015) 2px,
        rgba(0, 0, 0, 0.015) 4px
    );
    z-index: 9999;
}

/* Blinking cursor effect for brand */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.brand-cursor {
    display: inline-block;
    width: 10px;
    height: 14px;
    background: #e8833a;
    margin-left: 4px;
    animation: blink 1s infinite;
    vertical-align: middle;
}

/* Separator line pixel style */
.pixel-divider {
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        #e8833a 0px,
        #e8833a 8px,
        transparent 8px,
        transparent 12px
    );
    margin: 24px 0;
}

/* Tool input/output min height */
.tool-input-output {
    min-height: 200px;
}

.tool-filter-panel,
.tool-output-extra,
.tool-inline-note {
    background: #fff8ee;
    border: 3px solid #c8c0b0;
    box-shadow: 4px 4px 0 #d8d0c0;
}

.tool-filter-panel {
    padding: 18px;
}

.tool-search-input {
    width: min(100%, 420px);
}

.tool-filter-btn {
    font-family: 'VT323', 'ZCOOL XiaoWei', monospace;
    font-size: 12px;
    line-height: 1.15;
    letter-spacing: 0.2px;
    padding: 10px 12px;
    box-shadow: 2px 2px 0 #d8d0c0;
    border-color: #c8c0b0;
    color: #7a7a8a;
}

.tool-filter-btn:hover {
    box-shadow: 1px 1px 0 #d8d0c0;
}

.tool-filter-btn.is-active {
    background: #e8833a;
    border-color: #e8833a;
    color: #fff8ee;
    box-shadow: 2px 2px 0 #d4722e;
}

.tool-output-extra,
.tool-inline-note {
    padding: 14px 16px;
    color: #7a7a8a;
}

.tool-output-extra strong,
.tool-inline-note strong {
    color: #e8833a;
}

.tool-output-extra .status-line + .status-line {
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 640px) {
    h1 { font-size: 12px; }
    h2 { font-size: 10px; }
    body { font-size: 16px; }
    .brand-logo { font-size: 11px !important; }
    .tool-filter-btn {
        font-size: 16px;
        padding: 9px 12px;
    }
}

/* Feedback FAB */
.feedback-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    background: #e8833a;
    color: #fff8ee;
    border: 3px solid #d4722e;
    box-shadow: 3px 3px 0 #c06020;
    padding: 10px 14px;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.feedback-fab:hover {
    background: #d4722e;
    box-shadow: 1px 1px 0 #c06020;
    transform: translate(2px, 2px);
}

/* Feedback overlay */
.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Feedback modal */
.feedback-modal {
    background: #fff8ee;
    border: 3px solid #e8833a;
    box-shadow: 6px 6px 0 #c06020;
    padding: 24px;
    width: 90%;
    max-width: 420px;
}

.feedback-modal h2 {
    color: #e8833a;
}

.feedback-close-btn {
    font-family: 'VT323', monospace;
    font-size: 24px;
    background: transparent;
    border: none;
    box-shadow: none;
    color: #7a7a8a;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.feedback-close-btn:hover {
    color: #e8833a;
    background: transparent;
    transform: none;
    box-shadow: none;
}

.feedback-modal textarea {
    width: 100%;
    min-height: 80px;
}

.feedback-modal input[type="text"] {
    width: 100%;
}
