
:root {
    --neon-primary: #00f3ff;
    --neon-secondary: #bc13fe;
    --neon-accent: #ff0055;
    --bg-dark: #05050a;
    --key-bg: #151520;
    --key-border: #2a2a35;
    --key-shadow: #000;
    --text-color: #e0e0e0;
    --panel-bg: rgba(21, 21, 32, 0.6);
    --panel-border: rgba(255, 255, 255, 0.05);
}

.light-theme {
    --neon-primary: #007bff;
    --neon-secondary: #6610f2;
    --neon-accent: #dc3545;
    --bg-dark: #f0f2f5;
    --key-bg: #ffffff;
    --key-border: #ced4da;
    --key-shadow: #adb5bd;
    --text-color: #212529;
    --panel-bg: rgba(255, 255, 255, 0.8);
    --panel-border: rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-color);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* Key Flash Animation */
@keyframes key-flash {
    0% {
        transform: scale(1) translateY(2px);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.05) translateY(2px);
        filter: brightness(1.8);
    }

    100% {
        transform: scale(1) translateY(2px);
        filter: brightness(1);
    }
}

.component {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.bar-panel {
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.theme-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: all 0.2s;
}

.theme-toggle:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.bar {
    font-size: 3rem;
    background: linear-gradient(to right, var(--neon-primary), var(--neon-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.light-theme .bar {
    text-shadow: none;
}

/* Display Area */
.key-display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--panel-bg);
    border-radius: 24px;
    margin-bottom: 40px;
    border: 1px solid var(--panel-border);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1), inset 0 0 30px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(20px);
    min-height: 250px;
    position: relative;
    overflow: hidden;
    transition: background 0.3s, border 0.3s;
}

.key-display-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-primary), transparent);
    animation: scanline 2s linear infinite;
}

@keyframes scanline {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.initial-message {
    font-size: 2rem;
    color: var(--text-color);
    opacity: 0.5;
    font-weight: 300;
    letter-spacing: 2px;
    animation: pulse 3s infinite;
}

.main-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    z-index: 2;
}

.key-code-wrapper {
    position: relative;
    margin-bottom: 10px;
    cursor: pointer;
}

.key-code-wrapper:hover .copy-hint {
    opacity: 1;
}

.copy-hint {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    background: var(--neon-primary);
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
}

.key-code-main {
    font-size: 8rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1;
    text-shadow:
            0 0 10px var(--neon-primary),
            0 0 20px var(--neon-primary),
            0 0 40px var(--neon-primary);
    font-family: 'Courier New', monospace;
}

.light-theme .key-code-main {
    text-shadow: 0 0 5px var(--neon-primary);
    color: var(--neon-primary);
}

.key-name-main {
    font-size: 2.5rem;
    color: var(--text-color);
    opacity: 0.9;
    margin-bottom: 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.light-theme .key-name-main {
    text-shadow: none;
}

.key-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 1000px;
}

.detail-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.light-theme .detail-card {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.detail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--neon-secondary);
    opacity: 0;
    transition: opacity 0.3s;
}

.detail-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.light-theme .detail-card:hover {
    background: #f8f9fa;
}

.detail-card:hover::before {
    opacity: 1;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-color);
    opacity: 0.6;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    word-break: break-all;
}

/* Full Keyboard Layout */
.keyboard-wrapper {
    background: var(--key-bg);
    padding: 30px;
    border-radius: 30px;
    box-shadow:
            0 20px 50px rgba(0, 0, 0, 0.2),
            0 0 0 1px var(--panel-border);
    max-width: 1300px;
    margin: 0 auto;
    user-select: none;
    overflow-x: auto;
    transition: background 0.3s;
}

.light-theme .keyboard-wrapper {
    background: #e9ecef;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.keyboard-main {
    display: flex;
    gap: 20px;
    min-width: 1100px;
}

.keyboard-section-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.keyboard-section-middle {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.keyboard-section-numpad {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-left: 10px;
}

.keyboard-row {
    display: flex;
    gap: 6px;
}

/* Key Styling */
.key {
    height: 45px;
    width: 45px;
    background: linear-gradient(180deg, var(--key-bg) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-radius: 6px;
    color: var(--text-color);
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: default;
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 3px solid var(--key-shadow);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.light-theme .key {
    background: #fff;
    border-top: 1px solid #fff;
    border-bottom: 3px solid #ced4da;
}

.key:active,
.key.active {
    background: var(--neon-primary);
    color: #000;
    border-bottom: 1px solid var(--neon-primary);
    transform: translateY(2px);
    box-shadow:
            0 0 15px var(--neon-primary),
            0 0 30px var(--neon-primary);
    z-index: 2;
    text-shadow: none;
    opacity: 1;
    animation: key-flash 0.2s ease-out;
}

.key.active-modifier {
    background: var(--neon-secondary);
    color: #fff;
    border-bottom: 1px solid var(--neon-secondary);
    box-shadow:
            0 0 15px var(--neon-secondary),
            0 0 30px var(--neon-secondary);
    animation: key-flash 0.2s ease-out;
}

.key.active-accent {
    background: var(--neon-accent);
    color: #fff;
    border-bottom: 1px solid var(--neon-accent);
    box-shadow:
            0 0 15px var(--neon-accent),
            0 0 30px var(--neon-accent);
}

.key-label {
    pointer-events: none;
}

.key-sub {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 0.6rem;
    opacity: 0.6;
}

/* Key Sizes */
.w-1-25 {
    width: 56px;
}

.w-1-5 {
    width: 68px;
}

.w-1-75 {
    width: 79px;
}

.w-2 {
    width: 90px;
}

.w-2-25 {
    width: 101px;
}

.w-2-75 {
    width: 124px;
}

.w-6-25 {
    width: 281px;
}

.h-2 {
    height: 96px;
}

/* Spacers */
.spacer-0-5 {
    width: 22px;
}

.spacer-1 {
    width: 45px;
}

/* History */
.history-section {
    margin-top: 40px;
    width: 100%;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
}

.history-title {
    font-size: 1rem;
    color: var(--text-color);
    opacity: 0.5;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--text-color);
    opacity: 0.1;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
    border: 1px solid var(--panel-border);
    transition: all 0.2s;
    font-family: 'Courier New', monospace;
}

.light-theme .history-item {
    background: #fff;
    border-color: #dee2e6;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
    border-color: var(--neon-primary);
}

.light-theme .history-item:hover {
    background: #e9ecef;
}

@media (max-width: 1200px) {
    .keyboard-wrapper {
        overflow-x: auto;
        padding: 20px;
    }
}