@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-blur: 15px;
    --accent: #a18cd1;
    --btn-bg: #4c51bf;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 60px 20px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Background Blobs */
.bg-blobs {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: var(--primary-gradient);
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.15;
    animation: move 20s infinite alternate;
}

.blob-2 {
    right: -10%;
    bottom: -10%;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation-delay: -10s;
}

@keyframes move {
    from {
        transform: translate(-5%, -5%);
    }

    to {
        transform: translate(5%, 5%);
    }
}

/* Calculator Card */
.calculator-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    width: 95%;
    max-width: 850px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: #94a3b8;
    margin-top: 8px;
}

/* Calculation Rows */
.calculator-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calc-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    transition: all 0.3s;
}

.calc-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.calc-phrase {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    color: #cbd5e1;
    flex: 1;
}

.calc-phrase.vertical {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.phrase-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mini-input {
    width: 100px;
    padding: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.3s;
}

.mini-input:focus {
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 15px rgba(161, 140, 209, 0.2);
}

.calc-action {
    display: flex;
    align-items: center;
    gap: 15px;
}

.calc-btn {
    padding: 12px 24px;
    background: var(--btn-bg);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(76, 81, 191, 0.3);
}

.calc-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 15px rgba(76, 81, 191, 0.4);
}

.calc-btn:active {
    transform: translateY(0);
}

.result-box {
    position: relative;
    width: 120px;
}

.result-box input {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(161, 140, 209, 0.3);
    border-radius: 10px;
    color: #43e97b;
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    outline: none;
}

.result-box.with-unit input {
    padding-right: 35px;
}

.result-box .unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-weight: 600;
}

.clear-all-row {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.clear-btn {
    padding: 12px 30px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: #94a3b8;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.clear-btn:hover {
    border-color: #f5576c;
    color: #f5576c;
    background: rgba(245, 87, 108, 0.05);
}

@media (max-width: 768px) {
    .calc-row {
        flex-direction: column;
        align-items: stretch;
    }

    .calc-phrase {
        justify-content: center;
        flex-wrap: wrap;
    }

    .calc-action {
        justify-content: center;
        flex-wrap: wrap;
    }

    header h1 {
        font-size: 2rem;
    }
}