/* ===== DARK THEME WITH OVERLAY HEADER & PURPLE TONES ===== */

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

:root {
    /* Dark Theme with Purple Accents */
    --bg-dark: #0f0f1e;
    --bg-darker: #0a0a14;
    --color-purple: #a78bfa;
    --color-purple-light: #c4b5fd;
    --color-blue: #93c5fd;
    --color-cyan: #67e8f9;
    --color-green: #86efac;
    --color-pink: #fbcfe8;
    --color-text: #e5e7eb;
    --color-text-secondary: #9ca3af;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== LAYOUT ===== */

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 15, 30, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(167, 139, 250, 0.2);
    padding: 18px 30px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--color-purple);
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    font-weight: 400;
}

main {
    flex: 1;
    margin-top: 160px;
    padding: 30px 20px 40px;
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid rgba(167, 139, 250, 0.1);
}

footer a {
    color: var(--color-purple);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

/* ===== CALCULATOR LAYOUT ===== */

.calculator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    max-width: 900px;
    margin: 0 auto;
    align-items: start;
}

.inputs-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 100px;
}

.results-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 100px;
}

/* ===== INPUT GROUPS ===== */

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(167, 139, 250, 0.08);
    border: 1.5px solid rgba(167, 139, 250, 0.25);
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--color-purple);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
    background: rgba(167, 139, 250, 0.12);
}

input[type="number"] {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-purple-light);
    outline: none;
    font-family: 'Monaco', monospace;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"][type="number"] {
    -moz-appearance: textfield;
}

.unit {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.help-text {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    font-weight: 400;
}

/* ===== RESULTS GRID ===== */

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.result-card {
    background: rgba(167, 139, 250, 0.05);
    border: 1.5px solid rgba(167, 139, 250, 0.2);
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.result-card:hover {
    border-color: var(--color-purple);
    box-shadow: 0 8px 16px rgba(167, 139, 250, 0.15);
    transform: translateY(-2px);
}

.result-card.highlight {
    background: rgba(134, 239, 172, 0.08);
    border-color: var(--color-green);
}

.result-card.highlight:hover {
    box-shadow: 0 8px 16px rgba(134, 239, 172, 0.15);
    border-color: var(--color-green);
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-purple-light);
    font-family: 'Monaco', monospace;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.result-card.highlight .result-value {
    color: var(--color-green);
    font-size: 2.2rem;
}

.result-label {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== DETAILS SECTION ===== */

.details-section {
    margin-top: 12px;
}

.details-button {
    background: none;
    border: none;
    color: var(--color-purple);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.details-button:hover {
    color: var(--color-cyan);
}

.details-button::after {
    content: '▼';
    font-size: 0.5rem;
    transition: transform 0.3s ease;
}

.details-button.open::after {
    transform: rotate(180deg);
}

.details-content {
    margin-top: 14px;
    background: rgba(167, 139, 250, 0.05);
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: 8px;
    padding: 16px;
    backdrop-filter: blur(10px);
}

.details-content.hidden {
    display: none;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(167, 139, 250, 0.1);
    font-size: 0.85rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row > span:first-child {
    color: var(--color-text-secondary);
}

.detail-value {
    color: var(--color-purple-light);
    font-weight: 600;
    font-family: 'Monaco', monospace;
}

/* ===== SHIP IT STAMP ===== */

.ship-it-stamp {
    position: fixed;
    top: 28px;
    right: 30px;
    z-index: 101;
    width: 90px;
    height: 90px;
    border: 2px dashed var(--color-purple);
    border-radius: 50%;
    background: rgba(15, 15, 30, 0.9);
    cursor: pointer;
    transform: rotate(-20deg);
    transition: all 0.3s ease;
    font-size: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.2);
    backdrop-filter: blur(10px);
}

.ship-it-stamp:hover {
    transform: rotate(-20deg) scale(1.08);
    border-color: var(--color-pink);
    box-shadow: 0 6px 20px rgba(251, 207, 232, 0.3);
}

.ship-it-stamp:active {
    transform: rotate(-20deg) scale(0.96);
}

.stamp-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 900;
    color: var(--color-purple);
    text-align: center;
    letter-spacing: 1px;
    line-height: 1.1;
    pointer-events: none;
}

.ship-it-stamp:hover .stamp-text {
    color: var(--color-pink);
}

.ship-it-stamp.stamped {
    animation: shipItPulse 0.5s ease-out;
}

@keyframes shipItPulse {
    0% {
        transform: rotate(-20deg) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: rotate(0deg) scale(1.15);
    }
    100% {
        transform: rotate(-20deg) scale(1);
        opacity: 1;
    }
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1024px) {
    .calculator {
        gap: 20px;
    }

    .results-grid {
        gap: 12px;
    }

    main {
        padding: 25px 20px 35px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 14px 20px;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    main {
        margin-top: 140px;
        padding: 20px 16px 30px;
    }

    .calculator {
        grid-template-columns: 1fr;
        gap: 20px;
    }

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

    .ship-it-stamp {
        width: 75px;
        height: 75px;
        top: 18px;
        right: 20px;
    }

    .stamp-text {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 12px 16px;
    }

    header h1 {
        font-size: 1.1rem;
        margin-bottom: 2px;
    }

    .subtitle {
        font-size: 0.7rem;
    }

    main {
        margin-top: 125px;
        padding: 16px 12px 24px;
    }

    .inputs-section {
        gap: 16px;
    }

    .input-wrapper {
        padding: 10px 12px;
    }

    input[type="number"] {
        font-size: 1.1rem;
    }

    .unit {
        font-size: 0.7rem;
    }

    .results-grid {
        gap: 12px;
    }

    .result-card {
        padding: 16px 12px;
        min-height: 110px;
    }

    .result-value {
        font-size: 1.6rem;
    }

    .result-card.highlight .result-value {
        font-size: 1.8rem;
    }

    .ship-it-stamp {
        width: 65px;
        height: 65px;
        top: 14px;
        right: 15px;
    }

    .stamp-text {
        font-size: 9px;
        letter-spacing: 0.5px;
    }

    .details-button {
        font-size: 0.7rem;
    }

    .detail-row {
        font-size: 0.8rem;
        padding: 6px 0;
    }
}

/* ===== ANIMATIONS ===== */

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

.result-card {
    animation: slideIn 0.3s ease forwards;
}

.result-card:nth-child(2) {
    animation-delay: 0.05s;
}

.result-card:nth-child(3) {
    animation-delay: 0.1s;
}

.result-card:nth-child(4) {
    animation-delay: 0.15s;
}

/* ===== UTILITIES ===== */

.hidden {
    display: none !important;
}
