:root {
    /* Color Palette - Premium Dark */
    --primary: #00d2ff;
    --primary-glow: rgba(0, 210, 255, 0.3);
    --secondary: #3a7bd5;
    --accent: #ff007a;
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --card-bg-dark: rgba(30, 41, 59, 0.7);
    --card-bg-light: rgba(255, 255, 255, 0.8);
    --text-dark: #f8fafc;
    --text-light: #1e293b;
    --border-dark: rgba(255, 255, 255, 0.1);
    --border-light: rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Glassmorphism */
    --glass-blur: 15px;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

body.light-mode {
    background-color: var(--bg-light);
    color: var(--text-light);
}

/* Layout Structure */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background: var(--card-bg-dark);
    backdrop-filter: blur(var(--glass-blur));
    border-right: var(--glass-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.light-mode .sidebar {
    background: var(--card-bg-light);
    border-right: 1px solid var(--border-light);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.logo-img {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    box-shadow: 0 0 20px var(--primary-glow);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    transition: all var(--transition-fast);
    opacity: 0.7;
    font-weight: 500;
}

.nav-link.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.light-mode .nav-link.active {
    background: rgba(0, 0, 0, 0.05);
}

.nav-link:hover {
    opacity: 1;
    transform: translateX(5px);
}

.nav-link i {
    font-size: 1.25rem;
    width: 24px;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: 280px;
    padding: 3rem;
    max-width: 1200px;
}

/* Sections */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scanner Specifics */
.scanner-container {
    background: var(--card-bg-dark);
    border-radius: 24px;
    padding: 2rem;
    border: var(--glass-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.light-mode .scanner-container {
    background: var(--card-bg-light);
    border: 1px solid var(--border-light);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
}

#reader {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: white;
    opacity: 0.8;
}

.scanner-placeholder i {
    font-size: 3rem;
}

.scanner-controls {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

justify-content: center;
gap: 1.5rem;
}

/* Generator Styling */
.generator-container {
    background: var(--card-bg-dark);
    padding: 2rem;
    border-radius: 20px;
    border: var(--glass-border);
}

.light-mode .generator-container {
    background: var(--card-bg-light);
    border: 1px solid var(--border-light);
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0.8;
}

textarea {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-dark);
    font-size: 1rem;
    resize: none;
    transition: var(--transition-fast);
}

.light-mode textarea {
    background: #fff;
    border-color: var(--border-light);
    color: var(--text-light);
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.qr-result-card {
    background: white;
    padding: 2rem;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: scaleUp 0.3s ease-out;
}

@keyframes scaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* History Styling */
.history-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.history-item {
    background: var(--card-bg-dark);
    padding: 1.5rem;
    border-radius: 16px;
    border: var(--glass-border);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.light-mode .history-item {
    background: var(--card-bg-light);
    border: 1px solid var(--border-light);
}

.history-item:hover {
    transform: translateY(-5px);
}

.history-type {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--primary-glow);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    width: fit-content;
}

.history-text {
    font-weight: 500;
    word-break: break-all;
}

.history-time {
    font-size: 0.8rem;
    opacity: 0.5;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 0;
    opacity: 0.3;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Settings */
.settings-card {
    background: var(--card-bg-dark);
    border-radius: 20px;
    border: var(--glass-border);
    overflow: hidden;
}

.setting-item {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: var(--glass-border);
}

.btn-danger {
    background: rgba(255, 0, 122, 0.1);
    color: #ff007a;
    border: 1px solid #ff007a;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

/* SEO Section */
.seo-section {
    border-top: 1px solid var(--border-dark);
    padding-top: 3rem;
    margin-bottom: 2rem;
}

.prose-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-dark), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lead {
    font-size: 1.2rem;
    opacity: 0.7;
    margin-bottom: 3rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

.guide-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-dark);
}

.guide-box h3 {
    margin-bottom: 1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.faq-section h2 {
    margin-bottom: 2rem;
}

details {
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
}

summary {
    padding: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-fast);
}

summary:hover {
    background: rgba(255, 255, 255, 0.05);
}

details p {
    padding: 0 1rem 1rem 1rem;
    opacity: 0.8;
}

.internal-links {
    margin-top: 4rem;
}

.link-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.link-cloud a {
    background: var(--card-bg-dark);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    color: var(--primary);
    border: 1px solid var(--primary-glow);
    transition: var(--transition-fast);
}

.link-cloud a:hover {
    background: var(--primary);
    color: white;
}

/* Footer & Ping Status */
.app-footer {
    margin-top: 5rem;
    padding-bottom: 3rem;
    border-top: 1px solid var(--border-dark);
    padding-top: 2rem;
    text-align: center;
}

.ping-status {
    margin-top: 1rem;
    font-size: 0.8rem;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Scan Feedback */
.scan-feedback {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 10px 30px var(--primary-glow);
    z-index: 9999;
    animation: slideDownUp 2s ease-in-out forwards;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@keyframes slideDownUp {
    0% {
        transform: translate(-50%, -100%);
        opacity: 0;
    }

    20% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    80% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 1rem;
    }

    .logo-text,
    .nav-link span {
        display: none;
    }

    .main-content {
        margin-left: 80px;
        padding: 2rem;
    }
}

@media (max-width: 640px) {
    .app-container {
        flex-direction: column-reverse;
    }

    .sidebar {
        width: 100%;
        height: 70px;
        position: fixed;
        bottom: 0;
        left: 0;
        padding: 0 1rem;
        flex-direction: row;
        border-right: none;
        border-top: var(--glass-border);
    }

    .logo-section {
        display: none;
    }

    .nav-links {
        display: flex;
        width: 100%;
        justify-content: space-around;
    }

    .nav-link {
        flex-direction: column;
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-bottom: 90px;
    }
}