:root {
    --bg-app: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: #4338ca;
    /* Deep indigo/purple from image */
    --primary-light: #e0e7ff;
    --accent: #3b82f6;
    --success: #22c55e;
    --error: #ef4444;
    --border-color: #e2e8f0;
    --font-main: 'Outfit', sans-serif;
    --radius-lg: 24px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-app);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Layout */
.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s ease;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
}

.sidebar h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-group {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-left: 0.75rem;
    font-weight: 600;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    font-weight: 500;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-app);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background-color: #f3f4f6;
    /* Lighter background for main area */
}

.top-bar {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-only {
    display: none;
}

#menu-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

#page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    display: none;
    /* Hidden based on the image design which has titles in cards */
}

.share-btn {
    margin-left: auto;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background-color 0.2s ease, transform 0.1s ease;
    font-family: var(--font-main);
    white-space: nowrap;
}

.share-btn:hover {
    background-color: #3730a3;
    transform: translateY(-2px);
}

.share-btn:active {
    transform: translateY(0);
}

.content-area {
    flex: 1;
    padding: 0 0.5rem 3rem;
    overflow-y: auto;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Hide scrollbar for content area */
.content-area::-webkit-scrollbar {
    display: none;
}

.content-area {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* --- CALCULATOR SPECIFIC STYLES --- */

/* The main grid layout for the calculator view */
.calc-grid-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* TOP CARD: Inputs */
.input-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-header i {
    color: var(--primary);
}

.inputs-row {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.input-group {
    flex: 1;
    min-width: 200px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stylized-input {
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    transition: border-color 0.2s;
    outline: none;
}

.stylized-input:focus {
    border-color: var(--primary);
}

.stylized-input::placeholder {
    font-style: italic;
}

.stylized-input.error {
    border-color: #dc2626;
}

.input-error {
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    display: none;
    min-height: 1.2rem;
}

.input-error.show {
    display: block;
}

/* Operation Selector */
.operation-selector {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
    gap: 4px;
}

.op-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.op-btn:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.5);
}

.op-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    font-weight: bold;
}

/* BOTTOM SECTION: Split view */
.bottom-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Left: Graph Paper Calculation */
.paper-card {
    min-height: 300px;
}

.paper-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-instruction {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.step-number {
    background: var(--primary-light);
    color: var(--primary);
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Graph Paper Effect */
.graph-paper {
    background-color: #f8fafc;
    background-image:
        linear-gradient(#e2e8f0 1px, transparent 1px),
        linear-gradient(90deg, #e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: -1px -1px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 24px;
    line-height: 40px;
    /* Aligns with grid height (20px * 2) */
    color: #334155;
    position: relative;
    /* To ensure numbers align to grid */
    letter-spacing: 0.2em;
}

/* Right: Result & Guide */
.result-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-card {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    text-align: center;
    padding: 0.5rem 2rem;
    position: relative;
    overflow: hidden;
}

.result-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.result-value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 1rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.big-check-icon {
    position: absolute;
    bottom: -20px;
    right: -20px;
    font-size: 10rem;
    opacity: 0.1;
    transform: rotate(-10deg);
}

.guide-card {
    background: #ffffff;
}

.guide-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1e293b;
}

.guide-list {
    list-style: none;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.guide-list li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.guide-list li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    flex-shrink: 0;
}

/* --- OTHER SECTIONS (Kept minimal but compatible) --- */
.hero-card {
    background: white;
    padding: 3rem;
    text-align: center;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

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

.feature-card {
    background: white;
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

/* Responsiveness */
@media (max-width: 900px) {
    .bottom-section {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: absolute;
        height: 100%;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-only {
        display: block;
    }

    .graph-paper {
        font-size: 18px;
        line-height: 32px;
        letter-spacing: 0.15em;
        padding: 14px;
    }

    .content-area {
        padding: 0 0.5rem 12rem;
    }

    .steps-card {
        margin-bottom: 5rem;
    }
}

/* Calc Specifics */
.calc-row {
    font-family: monospace;
    white-space: pre;
    display: block;
}

.carry-row {
    color: var(--error);
    /* Grey */
    font-size: 1em;
    /* Keep same size for perfect alignment */
    height: 20px;
    /* Match grid line height roughly or smaller */
    line-height: 20px;
    opacity: 0.8;
    font-weight: normal;
    /* No letter spacing modification so it matches monospaced grid perfectly */
}

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow: hidden;
}

.sidebar .logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.sidebar h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

.nav-icon {
    font-size: 1.1rem;
}

.main-content {
    margin-left: 260px;
}

#page-title {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Mobile responsive */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-only {
        display: block !important;
    }
}

/* Pythagore Section */
.pythagore-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.triangle-svg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.formula {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}

.pythagore-inputs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    flex: 1;
}

.pythagore-inputs .input-group {
    min-width: 150px;
}

.pythagore-steps {
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.step-line {
    padding: 0.25rem 0;
    font-size: 0.95rem;
    color: var(--text-main);
}

.step-line:empty {
    height: 0.75rem;
}

.pythagore-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: var(--radius-sm);
}

.result-label-small {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.result-value-small {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* Geometry Section */
.geometry-selector {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.shape-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s;
}

.shape-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.shape-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.shape-icon {
    font-size: 1.1rem;
}

.shape-inputs {
    display: block;
}

.shape-inputs.hidden {
    display: none;
}

/* Converter Section */
.converter-selector {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.unit-type-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s;
}

.unit-type-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.unit-type-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.unit-icon {
    font-size: 1.1rem;
}

.conversion-inputs {
    margin-top: 1.5rem;
}

.input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.unit-select {
    flex: 0 0 auto;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
    color: var(--text-main);
    cursor: pointer;
    transition: border-color 0.2s;
}

.unit-select:focus {
    outline: none;
    border-color: var(--primary);
}

.conversion-arrow {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 100%;
    padding-bottom: 0.75rem;
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: bold;
}

/* Cross Product Styles */
.crossproduct-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.cross-table-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

.cross-cell {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cross-cell label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.cross-cell input {
    text-align: center;
}

/* Decimals Styles */
.decimals-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.decimal-inputs-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: flex-end;
    gap: 0.75rem;
    width: 100%;
    max-width: 500px;
}

.decimal-inputs-section .input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.decimal-inputs-section .input-group label {
    font-size: 0.85rem;
}

.decimal-inputs-section .stylized-input {
    font-size: 1rem;
}

.fraction-divider {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-align: center;
    margin-bottom: 0.5rem;
    line-height: 1;
}

@media (max-width: 600px) {
    .decimal-inputs-section {
        grid-template-columns: 1fr;
        gap: 1rem;
        align-items: stretch;
    }

    .decimal-inputs-section .input-group {
        width: 100%;
    }

    .decimal-inputs-section .stylized-input {
        font-size: 1rem;
        padding: 0.75rem 1rem;
        width: 100%;
    }

    .fraction-divider {
        display: none;
    }
}

.stylized-select {
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: var(--text-main);
    cursor: pointer;
    transition: border-color 0.2s;
    outline: none;
}

.stylized-select:focus {
    border-color: var(--primary);
}

/* --- FANCY INPUT STYLES --- */

.fancy-input {
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.fancy-input:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 8px rgba(67, 56, 202, 0.08), 0 2px 4px rgba(67, 56, 202, 0.04);
    transform: translateY(-1px);
}

.fancy-input:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(67, 56, 202, 0.1), 0 8px 16px rgba(67, 56, 202, 0.12);
    transform: translateY(-2px);
}

.fancy-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.6;
    font-weight: 400;
}

.fancy-input::-webkit-inner-spin-button,
.fancy-input::-webkit-outer-spin-button {
    opacity: 0.7;
}

.fancy-input.error {
    border-color: var(--error);
    background: #fef2f2;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Input Group Enhancement */
.input-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: color 0.2s ease;
}

.input-group:has(.fancy-input:focus) label {
    color: var(--primary);
}

/* Input Grid for Simplify Page */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* --- CALC SECTION STYLES --- */

.calc-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calc-btn {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, #3730a3 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1rem;
    box-shadow: 0 4px 6px rgba(67, 56, 202, 0.2), 0 2px 4px rgba(67, 56, 202, 0.1);
    font-family: var(--font-main);
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(67, 56, 202, 0.25), 0 4px 8px rgba(67, 56, 202, 0.15);
}

.calc-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(67, 56, 202, 0.2);
}

.calc-btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    box-shadow: 0 4px 6px rgba(100, 116, 139, 0.2), 0 2px 4px rgba(100, 116, 139, 0.1);
}

.calc-btn-secondary:hover {
    box-shadow: 0 8px 12px rgba(100, 116, 139, 0.25), 0 4px 8px rgba(100, 116, 139, 0.15);
}

.btn-icon {
    font-size: 1.3rem;
}

/* Result Section */
.result-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-content {
    color: var(--text-main);
}

/* Info Section */
.info-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.info-card {
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.info-card:last-child {
    margin-bottom: 0;
}

.info-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.info-card p:last-child {
    margin-bottom: 0;
}

.info-list {
    list-style: none;
    padding-left: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
}

.info-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.info-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
}

.info-card ol.info-list {
    list-style: none;
    counter-reset: item;
}

.info-card ol.info-list li::before {
    content: counter(item) ".";
    counter-increment: item;
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
}

/* --- FRACTION SIMPLIFICATION SPECIFIC STYLES --- */

.fraction-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem 1rem;
    flex-wrap: wrap;
}

.fraction-original,
.fraction-simplified {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.fraction-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fraction-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 2rem;
    font-weight: 600;
}

.fraction-numerator {
    color: var(--primary);
}

.fraction-line {
    width: 100%;
    height: 3px;
    background: var(--primary);
    min-width: 60px;
}

.fraction-denominator {
    color: var(--primary);
}

.fraction-arrow {
    font-size: 2rem;
    color: var(--accent);
}

.result-message {
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    margin-top: 1rem;
}

.result-message.success {
    background: #d1fae5;
    color: #065f46;
}

.steps-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.steps-box h4 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.step-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-number {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.step-content {
    flex: 1;
}

.step-content strong {
    color: var(--text-main);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.step-detail {
    margin-top: 0.75rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
}

.step-detail p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.step-detail code {
    background: var(--bg-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--primary);
    font-weight: 600;
}

.euclidean-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    margin: 0.5rem 0;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.step-badge {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.result-highlight {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    font-weight: 600;
    color: var(--primary);
}

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

.divisor-item {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.divisor-item.highlight {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-color: var(--accent);
}

.divisor-item strong {
    display: block;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.divisor-list {
    color: var(--text-secondary);
    line-height: 1.6;
    font-family: 'Courier New', monospace;
    word-break: break-word;
}

.info-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-box h4 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-box p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.info-box code {
    background: var(--bg-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--primary);
    font-weight: 600;
}

.info-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

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

.example-item {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-color);
}

.example-item strong {
    display: block;
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.example-item small {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .fraction-display {
        flex-direction: column;
        gap: 1rem;
    }

    .fraction-arrow {
        transform: rotate(90deg);
    }

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

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

/* --- EXPRESSION CALCULATOR STEPS (compact version) --- */

.expression-steps {
    margin-top: 0.75rem;
}

.calc-step {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 6px 0;
    background-color: #f9f9f9;
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    opacity: 0;
    transform: translateX(-10px);
    animation: calcStepSlideIn 0.3s ease forwards;
}

@keyframes calcStepSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.calc-step-number {
    background-color: var(--primary);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.calc-step-content {
    flex: 1;
}

.calc-step-expression {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    color: #333;
}

.calc-step-expression.highlight {
    background-color: #ffeb3b;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.calc-step-explanation {
    color: #888;
    font-size: 0.8rem;
    margin-top: 2px;
}

.calc-step-arrow {
    text-align: center;
    color: var(--primary);
    font-size: 1rem;
    margin: 2px 0;
    opacity: 0;
    animation: calcStepSlideIn 0.2s ease forwards;
}

.calc-result {
    background-color: var(--success);
    color: white;
    padding: 12px 16px;
    text-align: center;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 1.1rem;
    opacity: 0;
    animation: calcStepSlideIn 0.3s ease forwards;
}

.calc-result strong {
    font-weight: 700;
}

/* PWA Install Button */
.pwa-install-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    animation: slideInUp 0.4s ease-out;
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(67, 56, 202, 0.4);
}

.pwa-install-btn:active {
    transform: translateY(0);
}

.pwa-install-btn .install-icon {
    font-size: 18px;
}

.pwa-install-btn .install-text {
    white-space: nowrap;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .pwa-install-btn {
        bottom: 16px;
        right: 16px;
        padding: 10px 16px;
        font-size: 13px;
    }

    .pwa-install-btn .install-icon {
        font-size: 16px;
    }
}

/* --- ANGLE CLASSIFIER STYLES --- */

.angle-classifier-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

.angle-input-section {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
}

.angle-result-section {
    min-height: 400px;
}

.angle-result-display {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-color);
    transition: all 0.3s ease;
}

.angle-placeholder {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.angle-type-badge {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-size: 1.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeInScale 0.4s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.angle-value-display {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 1rem 0;
    color: var(--text-main);
    animation: fadeInUp 0.5s ease-out;
}

.angle-info-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-md);
    border-left: 4px solid currentColor;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.angle-info-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.angle-info-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.angle-visual-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.angle-visual-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 900px) {
    .angle-classifier-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .angle-input-section {
        order: 1;
    }

    .angle-result-section {
        order: 2;
        min-height: 300px;
    }

    .angle-result-display {
        min-height: 300px;
    }
}
