/* ==================== NeoOrb PWA v2.03 - Cyber-Glass Design ==================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Orbitron:wght@500;600;700;800;900&display=swap');

/* ========================================= */
/* ============= CSS Variables ============= */
/* ========================================= */
:root {
    /* Cyberpunk Colors */
    --neon-cyan: #00ffff;
    --neon-magenta: #ff00ff;
    --neon-yellow: #ffff00;
    --neon-green: #00ff41;
    --cyber-dark: #0d1117;
    --cyber-darker: #010409;

    /* Glass Effects */
    --glass-bg: rgba(13, 17, 23, 0.7);
    --glass-border: rgba(0, 255, 255, 0.2);
    --glass-hover: rgba(0, 255, 255, 0.1);

    /* Text Colors */
    --text-color: #00ffff;
    --text-primary: #00ffff;
    --text-secondary: #a8b2d1;
    --text-muted: #6b7280;
    --text-dark: #0d1117;

    /* Legacy compatibility */
    --accent-color: #00ffff;
    --accent-hover: #00ff41;
    --bg-color: #0d1117;
    --card-color: rgba(13, 17, 23, 0.7);
    --border-color: rgba(0, 255, 255, 0.2);
    --shadow-color: rgba(0, 255, 255, 0.2);

    /* Shadows */
    --shadow-glow: 0 8px 32px 0 rgba(0, 255, 255, 0.2);

    /* Fonts */
    --font-family: 'Poppins', sans-serif;
    --font-heading: 'Orbitron', sans-serif;
}

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

/* ========================================= */
/* ============= Body & Layout ============= */
/* ========================================= */
body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #0a0e1a 0%, #1a0e2e 50%, #0a1929 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Animated grid background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

/* Glowing particles */
body::after {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(0, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 0, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(0, 255, 65, 0.15) 0%, transparent 50%);
    z-index: -1;
    animation: particleFloat 15s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ========================================= */
/* ============= Header ==================== */
/* ========================================= */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--neon-cyan);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px var(--neon-cyan);
}

.logo h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 900;
}

.logo i {
    font-size: 2rem;
    animation: rotate 10s linear infinite;
    filter: drop-shadow(0 0 10px var(--neon-cyan));
}

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

#connection-status {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}

/* ========================================= */
/* ============= Footer ==================== */
/* ========================================= */
footer {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 2px solid var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    margin-top: 4rem;
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========================================= */
/* ============= Typography ================ */
/* ========================================= */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.page-title {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 900;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px var(--neon-cyan);
    text-align: center;
    margin-bottom: 2rem;
}

/* ========================================= */
/* ============= Cards ===================== */
/* ========================================= */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-glow);
    margin-bottom: 2rem;
    transition: all 0.4s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 255, 255, 0.4);
    border-color: rgba(0, 255, 255, 0.4);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 1.5rem;
}

/* ========================================= */
/* ============= Buttons =================== */
/* ========================================= */
button {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--neon-cyan);
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.primary-button {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.3), rgba(0, 255, 65, 0.3));
    color: var(--neon-cyan);
}

.primary-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.primary-button:hover::before {
    left: 100%;
}

.primary-button:hover {
    box-shadow: 0 0 20px var(--neon-cyan), 0 0 40px rgba(0, 255, 255, 0.5);
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.5), rgba(0, 255, 65, 0.5));
}

.secondary-button {
    background: var(--glass-bg);
    color: var(--neon-cyan);
}

.secondary-button:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    transform: translateY(-2px);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* ========================================= */
/* ============= Hub Grid ================== */
/* ========================================= */
.welcome-message {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-glow);
}

.welcome-message h2 {
    margin: 0 0 1rem 0;
    color: var(--neon-cyan);
    font-size: 2rem;
    text-shadow: 0 0 20px var(--neon-cyan);
}

.welcome-message p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.hub-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hub-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--neon-cyan), var(--neon-magenta), var(--neon-yellow), var(--neon-green));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s;
    border-radius: 16px;
}

.hub-card:hover::before {
    opacity: 1;
    animation: borderGlow 1.5s linear infinite;
}

@keyframes borderGlow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.hub-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 255, 255, 0.4);
}

.hub-card i {
    font-size: 3.5rem;
    color: var(--neon-cyan);
    margin-bottom: 1.5rem;
    display: block;
    filter: drop-shadow(0 0 10px var(--neon-cyan));
}

.hub-card h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--neon-cyan);
}

.hub-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
    flex-grow: 1;
}

.hub-card span {
    color: var(--neon-green);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========================================= */
/* ============= Profiles ================== */
/* ========================================= */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.profile-tile {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    aspect-ratio: 1/1;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    padding: 1rem;
}

.profile-tile::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--neon-cyan), var(--neon-magenta), var(--neon-yellow), var(--neon-green));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 12px;
}

.profile-tile:hover::before {
    opacity: 1;
    animation: borderGlow 1.5s linear infinite;
}

.profile-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 255, 255, 0.4);
}

.profile-tile.empty {
    opacity: 0.6;
    border-style: dashed;
}

.profile-tile i {
    font-size: 2.5rem;
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 10px var(--neon-cyan));
}

.profile-tile div {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--neon-cyan);
    text-transform: uppercase;
    font-size: 1rem;
}

/* ========================================= */
/* ============= Editor ==================== */
/* ========================================= */
.profile-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--shadow-glow);
}

#current-icon-display {
    font-size: 2rem;
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 10px var(--neon-cyan));
}

#profile-name-input {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    border: 2px solid var(--neon-cyan);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    background: rgba(0, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: var(--neon-cyan);
    text-transform: uppercase;
    min-width: 250px;
}

#profile-name-input::placeholder {
    color: var(--text-muted);
}

/* Keypad Grid - 15 Tasten (5x3) */
#keypad-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.key {
    aspect-ratio: 1/1;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    color: var(--neon-cyan);
    font-weight: 600;
    font-size: clamp(0.7rem, 2vw, 0.95rem);
    text-align: center;
}

/* Prägnante Farbdarstellung für Hardware-Vorschau */
.key[style*="background"] {
    box-shadow: inset 0 0 40px currentColor;
}

.key::before {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0.15;
    transition: opacity 0.3s;
    border-radius: 10px;
}

/* Rainbow Hover Effekt */
.key::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--neon-cyan), var(--neon-magenta), var(--neon-yellow), var(--neon-green));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 12px;
}

.key:hover::after {
    opacity: 1;
    animation: borderGlow 1.5s linear infinite;
}

.key:hover::before {
    opacity: 0.3;
}

.key:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.5);
    color: var(--text-dark);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    font-weight: 700;
}

.key:active {
    transform: translateY(1px) scale(0.98);
}

/* ========================================= */
/* ============= Modals ==================== */
/* ========================================= */
.modal-hidden {
    display: none !important;
}

.modal {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    position: relative;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--neon-cyan);
    font-size: 1.5rem;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.close-button:hover {
    color: var(--neon-cyan);
    transform: rotate(90deg);
}

/* ========================================= */
/* ============= Forms ===================== */
/* ========================================= */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

select,
input[type="text"],
textarea,
input[type="number"],
input[type="color"],
input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(0, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: var(--neon-cyan);
    box-sizing: border-box;
    font-size: 1rem;
    font-family: var(--font-family);
    transition: all 0.2s;
}

select:focus,
input[type="text"]:focus,
textarea:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.checkbox-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    text-transform: none;
    margin-bottom: 0;
}

.checkbox-group input {
    width: auto;
    cursor: pointer;
}

.config-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.config-column h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--neon-green);
    margin-top: 0;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* ========================================= */
/* ============= Icon Picker =============== */
/* ========================================= */
#icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.icon-option {
    font-size: 2rem;
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-muted);
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}

.icon-option:hover {
    background: rgba(0, 255, 255, 0.15);
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

/* ========================================= */
/* ============= File Manager ============== */
/* ========================================= */
.file-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.file-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--glass-border);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.file-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

.file-table tr:hover {
    background-color: rgba(0, 255, 255, 0.05);
}

.directory-item span {
    cursor: pointer;
    font-weight: bold;
    color: var(--neon-cyan);
}

.directory-item span:hover,
.file-item span:hover {
    color: var(--neon-green);
}

.col-icon { width: 40px; }
.col-name { width: auto; }
.col-size, .col-modified {
    width: 140px;
    text-align: right;
    font-family: 'Courier New', Courier, monospace;
}
.col-actions { width: 80px; text-align: center; }

/* ========================================= */
/* ============= Update Notification ======= */
/* ========================================= */
.update-notification {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--neon-cyan);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.update-notification i {
    font-size: 1.5rem;
    color: var(--neon-cyan);
}

.update-notification span {
    flex-grow: 1;
    color: var(--text-secondary);
}

.update-notification button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* ========================================= */
/* ============= Compare Area ============== */
/* ========================================= */
#compare-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

#compare-area > div {
    background: rgba(0, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

#existing-profile-display,
#imported-profile-display {
    color: var(--text-secondary);
}

/* ========================================= */
/* ============= Responsive ================ */
/* ========================================= */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }

    .logo {
        font-size: 1.5rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .container {
        padding: 1.5rem 1rem;
    }

    .hub-grid {
        grid-template-columns: 1fr;
    }

    .profiles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #keypad-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .key {
        padding: 0.75rem;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    #compare-area {
        grid-template-columns: 1fr;
    }

    .profile-controls {
        flex-direction: column;
        align-items: stretch;
    }

    #profile-name-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #keypad-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .key {
        padding: 0.5rem;
        gap: 0.25rem;
        font-size: 0.7rem;
    }

    .profiles-grid {
        grid-template-columns: 1fr;
    }
}

/* Landscape mode on mobile */
@media (max-width: 900px) and (orientation: landscape) {
    #keypad-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ========================================= */
/* ============= Scrollbar ================= */
/* ========================================= */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--cyber-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 5px;
    box-shadow: 0 0 10px var(--neon-cyan);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-green);
    box-shadow: 0 0 15px var(--neon-green);
}
