:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --text-main: #0f172a;
    --text-muted: #334155;
    --border: rgba(255, 255, 255, 0.4);
    --accent: #e0e7ff;
    --radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: linear-gradient(rgba(0,0,0,0.15), rgba(0,0,0,0.15)),
    url("background.png") no-repeat center center fixed;
    background-size: cover;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.calculator-wrapper {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.25);
    max-width: 550px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-badge {
    font-size: 36px;
    margin-bottom: 8px;
}

header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.025em;
    margin-bottom: 4px;
}

header .subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.selection-section {
    margin-bottom: 24px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    background-color: rgba(255, 255, 255, 0.4);
    border-color: var(--primary);
    color: var(--primary);
}

.checkbox-label input {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

.input-group {
    margin-bottom: 16px;
}

label.input-title {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input, select {
    width: 100%;
    padding: 13px 16px;
    font-size: 14px;
    background-color: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease-in-out;
    color: var(--text-main);
}

input::placeholder {
    color: rgba(15, 23, 42, 0.4);
}

input:focus, select:focus {
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px var(--accent);
}

.primary-btn {
    width: 100%;
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
    transition: all 0.2s ease-in-out;
    margin-top: 8px;
    margin-bottom: 24px;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.result-card, .history-card {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.history-card {
    background: rgba(255, 255, 255, 0.15);
}

.result-card h2, .history-card h2 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary);
}

#result-display {
    font-size: 13.5px;
    color: var(--text-main);
    font-weight: 500;
    white-space: pre-line;
}

#history-list {
    list-style-type: none;
    max-height: 120px;
    overflow-y: auto;
    font-size: 12.5px;
    color: var(--text-muted);
}

#history-list li {
    background: rgba(255, 255, 255, 0.35);
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.clear-btn {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 4px 10px;
    border-radius: 6px;
    color: var(--text-main);
    font-size: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--primary);
}

footer {
    text-align: center;
    margin-top: 24px;
    font-size: 9px;
    color: #cbd5e1;
    max-width: 550px;
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.divider {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 12px;
}

footer .footer-links, footer .social-links, footer .developer-info, footer .formulas {
    margin: 6px 0;
    line-height: 1.4;
    color: #94a3b8;
}

footer a {
    color: #818cf8;
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}

footer a:hover {
    color: #6366f1;
    text-decoration: underline;
}

.social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #94a3b8;
    margin: 10px 0;
}

.social-links a {
    font-size: 14px;
    color: #818cf8;
    transition: transform 0.2s;
}

.social-links a:hover {
    transform: scale(1.1);
    color: #6366f1;
}

.modal {
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    color: #f8fafc;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    text-shadow: none;
}

.close-btn {
    color: #94a3b8;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: #f8fafc;
}

.hidden {
    display: none;
}