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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #00d4ff, #0099ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #a0a0a0;
    font-size: 1.2rem;
}

.calculator {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.input-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

#magnetInput {
    flex: 1;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #ffffff;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

#magnetInput:focus {
    outline: none;
    border-color: #0099ff;
    box-shadow: 0 0 20px rgba(0, 153, 255, 0.3);
}

#calculateBtn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #0099ff, #0077ff);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#calculateBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 153, 255, 0.4);
}

.result-container {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.result-container.show {
    opacity: 1;
    transform: translateY(0);
}

.tesla-display {
    text-align: center;
    margin-bottom: 2rem;
}

.magnetic-field {
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
    position: relative;
    background: radial-gradient(circle, rgba(0, 153, 255, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

.tesla-value {
    font-size: 4rem;
    font-weight: bold;
    background: linear-gradient(135deg, #00d4ff, #0099ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.unit {
    font-size: 2rem;
    color: #0099ff;
    margin-left: 0.5rem;
}

.description {
    color: #a0a0a0;
    font-size: 1.2rem;
    margin-top: 1rem;
}

.comparison-section h3 {
    color: #ffffff;
    margin-bottom: 1rem;
    text-align: center;
}

.comparison-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bar-label {
    width: 120px;
    font-size: 0.9rem;
    color: #a0a0a0;
}

.bar {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #0099ff, #00d4ff);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.examples {
    margin-top: 2rem;
    text-align: center;
}

.examples h3 {
    color: #a0a0a0;
    margin-bottom: 1rem;
}

.example-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.chip {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.chip:hover {
    background: rgba(0, 153, 255, 0.2);
    border-color: #0099ff;
    transform: translateY(-2px);
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    
    .input-section {
        flex-direction: column;
    }
    
    .tesla-value {
        font-size: 3rem;
    }
}

/* Add these CSS custom properties for dynamic updates */
.bar {
    --width: 0%;
    --actual-width: 0%;
}

.bar::after {
    width: var(--actual-width, 0%);
}

.magnetic-field {
    --intensity: 0.3;
}

.magnetic-field::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(200px * var(--intensity));
    height: calc(200px * var(--intensity));
    background: radial-gradient(circle, rgba(0, 153, 255, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s ease-in-out infinite;
}

