:root {
    --background: #F8FAFC;
    --primary: #0A9E5A;
    --primary-hover: #087f49;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --bg-card: #FFFFFF;
    --border: #E2E8F0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.dark-mode {
    --background: #0F172A;
    --text-main: #F1F5F9;
    --text-muted: #94A3B8;
    --bg-card: #1E293B;
    --border: #334155;
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px)
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.header.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title {
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.navigation-links ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin-top: 0.5rem;
}

.navigation-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.navigation-links a:hover {
    color: var(--primary);
}

.thema-switch {
    display: flex;
    gap: 0.5rem;
    background-color: var(--background);
    padding: 0.25rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.thema-switch button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thema-switch button:hover {
    color: var(--primary);
    background-color: var(--bg-card);
}

.thema-switch button.active {
    background-color: var(--primary);
    color: var(--bg-card);
}

.main-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2rem;
    padding: 3rem 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    transition: grid-template-columns 0.5s ease, max-width 0.5s ease;
}

.main-grid:has(.results.is-visible) {
    grid-template-columns: 360px 1fr;
    justify-items: stretch;
    max-width: 1200px;
}

.form,
.results {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form {
    max-width: 400px;
    width: 100%;
    transition: all 0.3s ease-in-out;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    height: 48px;
    padding: 0 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--background);
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 158, 90, 0.1);
}

.input-readonly {
    background-color: var(--border) !important;
    cursor: not-allowed;
    user-select: none;
    border-style: dashed !important;
}

.msg-error {
    display: none;
    background-color: rgba(239, 68, 68, 0.2);
    border: 1px solid #EF4444;
    color: #EF4444;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    text-align: center;
    font-weight: 500;
    opacity: 0;
}

.msg-error.show {
    display: block;
    animation: fadeInDown 0.4s ease forwards;
}

.btn-calculate {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary);
    color: var(--bg-card);
    border: none;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-calculate:hover {
    background-color: var(--primary-hover);
}

.btn-clear {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 1rem;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.btn-clear:hover {
    background-color: var(--border);
    color: var(--text-main);
}

.chart-wrapper {
    margin-top: 1.5rem;
    min-height: 400px;
}

.results {
    display: none;
}

.results.is-visible {
    display: block;
    animation: slideUp 0.5s ease forwards;
}

.results-text {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.result-card {
    background-color: var(--background);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: transform 0.2s ease;
    margin-bottom: 0.5rem;
    min-width: 0;
    overflow: hidden;
}

.result-card span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.result-card strong {
    display: block;
    font-size: 1.5rem;
    color: var(--text-main);
    inline-size: 100%;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.2;
}

.highlight-secondary {
    color: var(--primary) !important;
}

.highlight-primary {
    color: #3B82F6 !important;
}

.footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
}

.footer ul {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer a i {
    margin-right: 8px;
    font-size: 1.1rem;
    vertical-align: middle;
}

.footer a:hover {
    color: var(--primary);
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background-color: var(--border);
    color: var(--text-main);
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: help;
    margin-left: 5px;
    position: relative;
    vertical-align: middle;
}

.tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-main);
    color: var(--bg-card);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: none;
    white-space: normal;
    width: 160px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: var(--shadow);

}

.tooltip-icon::before {
    content: "";
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text-main);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.tooltip-icon:hover::after,
.tooltip-icon:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

#about {
    grid-column: 1 / -1;
    scroll-margin-top: 80px;
}

.input-info {
    display: block;
    font-size: 0.65rem;
    color: var(--primary);
    margin-top: 4px;
    font-weight: 500;
}

.about-project {
    margin-top: 1.5rem;
    padding: 2.5rem;
    border-left: 4px solid var(--primary);
    background-color: var(--bg-card);
    border-radius: 12px;
    grid-column: 1 / -1;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.about-content {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.about-text p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.tech-stack h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.tech-list {
    list-style: none;
    padding: 0;
}

.tech-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.tech-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.dev-note {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.9rem;
    grid-column: 1 / -1;
}

@media(max-width: 480px) {
    .results-text {
        grid-template-columns: 1fr;
    }
}

@media(max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .about-project {
        padding: 1.5rem;
    }
}

@media(max-width: 968px) {

    .main-grid,
    .main-grid:has(.results.is-visible) {
        grid-template-columns: 1fr;
        justify-items: stretch;
        gap: 2rem;
        padding: 1.5rem;
    }

    .form,
    .results {
        max-width: 100%;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .navigation-links{
        display: flex;
        justify-content: center;
        padding: 0;
        margin: 0;
        list-style: none;
        gap: 1.5rem;
        width: 100%;
    }
}