@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette - Modern Dark Theme */
    --bg-dark: #0a0b10;
    --bg-card: #151726;
    --bg-input: #1e2133;
    --bg-sidebar: #0d0f1a;

    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --accent-indigo: #6366f1;
    --accent-indigo-hover: #4f46e5;
    --accent-indigo-glow: rgba(99, 102, 241, 0.3);

    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.2);
    --accent-rose: #f43f5e;
    --accent-rose-glow: rgba(244, 63, 94, 0.2);
    --accent-amber: #f59e0b;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-focus: #6366f1;

    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 4px;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-vibrant: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    width: 100%;
    height: 100%;
}

.hidden {
    display: none !important;
}

/* Sidebar */
.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
}

.logo-section {
    margin-bottom: 48px;
}

.logo-section h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-section h1::before {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--accent-indigo);
    border-radius: 3px;
    box-shadow: 0 0 15px var(--accent-indigo-glow);
}

.tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 500;
}

.info-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.group-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    font-weight: 700;
}

.info-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.sidebar-footer {
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

.help-btn {
    width: 100%;
    padding: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.help-btn:hover {
    background: var(--accent-indigo);
    color: #fff;
    border-color: var(--accent-indigo);
    box-shadow: 0 0 15px var(--accent-indigo-glow);
}

/* Main Content */
.dashboard-main {
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent 600px);
}

.settings-bar {
    display: flex;
    align-items: center;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-vibrant);
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.setting-item select {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: #fff;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    min-width: 240px;
}

.setting-item select:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px var(--accent-indigo-glow);
}

/* Converter Grid */
.converter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-vibrant);
    transition: var(--transition);
}

.dashboard-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
}

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

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.copy-btn:hover {
    background: var(--bg-input);
    color: var(--accent-indigo);
}

.copy-btn.copied {
    color: var(--accent-emerald);
    background: var(--accent-emerald-glow);
}

.format-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.card-body {
    padding: 32px 24px;
}

.large-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Inter', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: var(--transition);
}

.large-input::placeholder {
    color: var(--bg-input);
}

.large-input:focus {
    color: var(--accent-indigo);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: min(90%, 600px);
    position: relative;
    max-height: 80vh;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
}

.help-scroll {
    margin-top: 24px;
    overflow-y: auto;
    max-height: 50vh;
    padding-right: 12px;
}

.help-scroll section {
    margin-bottom: 32px;
}

.help-scroll h3 {
    margin-bottom: 12px;
    color: var(--accent-indigo);
}

.help-scroll p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.help-scroll ul {
    list-style: none;
    color: var(--text-secondary);
}

.help-scroll li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.help-scroll code {
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #fff;
}

/* Footer */
.main-footer {
    margin-top: auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.main-footer a {
    color: var(--accent-indigo);
    text-decoration: none;
}

.main-footer a:hover {
    text-decoration: underline;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-input);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 1fr;
        height: auto;
        overflow-y: visible;
    }

    .sidebar {
        height: auto;
        padding: 32px 24px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .info-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 24px;
        margin-top: 24px;
    }

    .sidebar-footer {
        display: none;
    }

    .dashboard-main {
        padding: 24px;
    }
}

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

    .large-input {
        font-size: 2.5rem;
    }

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

@media (max-width: 480px) {
    .large-input {
        font-size: 2rem;
    }

    .settings-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}