/* Modern Reset and CSS Variables */
:root {
    --bg-color: #0d1117;
    --sidebar-bg: #161b22;
    --card-bg: #1f242c;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --brand-color: #58a6ff;
    --brand-glow: rgba(88, 166, 255, 0.4);
    --border-color: #30363d;
    --input-bg: #0d1117;
    --focus-ring: #58a6ff;
    --danger: #f85149;
    --success: #2ea043;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

/* Scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.brand {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.brand h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2rem;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.brand h1 span {
    color: var(--brand-color);
    text-shadow: 0 0 15px var(--brand-glow);
}

.brand p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-menu {
    padding: 1.5rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section h3 {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    padding: 0 1.5rem 0.5rem;
}

.nav-section a {
    display: block;
    padding: 0.6rem 1.5rem 0.6rem 2.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

.nav-section a:hover,
.nav-section a.active {
    color: var(--brand-color);
    background: rgba(88, 166, 255, 0.05);
}

.nav-section a:hover::before,
.nav-section a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--brand-color);
    box-shadow: 0 0 10px var(--brand-glow);
    border-radius: 0 4px 4px 0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
}

.top-header {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-header h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.25rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

.version-badge {
    background: rgba(88, 166, 255, 0.1);
    color: var(--brand-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(88, 166, 255, 0.2);
}

.content-wrapper {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Glassmorphism Cards */
.calculator-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

.calculator-card h3 {
    font-family: var(--font-heading);
    margin-bottom: 1.5rem;
    color: var(--brand-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.input-group {
    display: flex;
    align-items: center;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-text {
    background: var(--border-color);
    padding: 0.75rem 1rem;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-left: none;
}

/* Result Box */
.result-box {
    background: rgba(88, 166, 255, 0.05);
    border: 1px dashed var(--brand-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin-top: 2rem;
}

.result-box .result-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-box .result-value {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 0.5rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Animations */
.slide-in {
    animation: slideIn 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }
}

.brand-logo {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: brightness(0) invert(1);
}

.brand {
    padding-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}