:root {
    --bg-color: #0d0f14;
    --card-bg: rgba(26, 29, 39, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8f9fa;
    --text-secondary: #9ba1a6;
    --accent: #f59e0b; /* Amber/gold */
    --accent-glow: rgba(245, 158, 11, 0.4);
    --secondary-accent: #fcd34d; /* Light gold */
    --success: #34d399;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 2rem 0;
}

/* Background aesthetic orbs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vmin;
    height: 50vmin;
    background: #d97706; /* Darker amber */
}

.orb-2 {
    bottom: -15%;
    right: -5%;
    width: 60vmin;
    height: 60vmin;
    background: #b45309;
}

.orb-3 {
    top: 30%;
    left: 60%;
    width: 30vmin;
    height: 30vmin;
    background: var(--secondary-accent);
    opacity: 0.2;
}

.app-container {
    width: 100%;
    max-width: 540px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 10;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo svg {
    stroke: var(--accent);
}

.toggle-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    display: flex;
    padding: 4px;
}

.toggle-container span {
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.toggle-container span.active {
    background: var(--card-border);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.controls-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.action-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 16px 32px rgba(0,0,0,0.2);
}

.select-wrapper {
    position: relative;
}

select {
    width: 100%;
    appearance: none;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s;
}

select:focus {
    border-color: var(--accent);
}

.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.dimension-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.input-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-block label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.input-block input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-block input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

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

.input-group label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    border: 1px solid var(--card-border);
}

input[type=range]::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -8px;
    box-shadow: 0 0 10px var(--accent-glow);
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="number"] {
    width: 90px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: border-color 0.3s;
    -moz-appearance: textfield;
}

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

input[type="number"]:focus {
    border-color: var(--accent);
}

/* X-Ray Visualizer */
.visualizer-wrapper {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.visualizer-container {
    width: 100%;
    height: 320px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.5);
}

.tank-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.6));
}

/* SVG Rendering Styles */
.svg-glass-back {
    fill: rgba(255, 255, 255, 0.02);
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.svg-fluid-top {
    fill: rgba(245, 158, 11, 0.8);
    stroke: rgba(252, 211, 77, 0.8);
    stroke-width: 1;
}

.svg-fluid-left {
    fill: rgba(217, 119, 6, 0.8);
    stroke: rgba(245, 158, 11, 0.6);
    stroke-width: 1;
}

.svg-fluid-right {
    fill: rgba(180, 83, 9, 0.8);
    stroke: rgba(217, 119, 6, 0.6);
    stroke-width: 1;
}

.svg-glass-front {
    fill: rgba(255, 255, 255, 0.05);
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1.5;
}

.results-display {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#volumeResult {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

.results-display small {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

footer {
    text-align: center;
    margin-top: auto;
}

.doc-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
    border-bottom: 1px dashed var(--text-secondary);
}

.doc-link:hover {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}
