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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    position: relative;
    overflow-x: hidden;
}

/* Sparkle effects */
#sparkles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    animation: sparkle 5s infinite;
    box-shadow: 0 0 3px 1px rgba(255, 255, 255, 0.6),
                0 0 5px 2px rgba(255, 215, 0, 0.4),
                0 0 8px 3px rgba(255, 192, 203, 0.2);
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) translateY(0);
    }
    50% {
        opacity: 1;
        transform: scale(1) translateY(-20px);
    }
}

.sparkle:nth-child(odd) {
    animation-delay: 0s;
    animation-duration: 4s;
}

.sparkle:nth-child(even) {
    animation-delay: 1.5s;
    animation-duration: 5s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2),
                 0 0 10px rgba(255, 255, 255, 0.5),
                 0 0 20px rgba(255, 215, 0, 0.3);
    animation: shimmer 3s ease-in-out infinite;
    position: relative;
}

@keyframes shimmer {
    0%, 100% {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2),
                     0 0 10px rgba(255, 255, 255, 0.5),
                     0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2),
                     0 0 20px rgba(255, 255, 255, 0.8),
                     0 0 30px rgba(255, 215, 0, 0.6),
                     0 0 40px rgba(255, 192, 203, 0.4);
    }
}

.calculator-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.calculator-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2),
                0 0 20px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: sparkle-sweep 4s infinite;
    pointer-events: none;
}

@keyframes sparkle-sweep {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.calculator-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3),
                0 0 30px rgba(255, 215, 0, 0.2);
}

.calculator-card h2 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    display: none;
}

.result.show {
    display: block;
}

.result.success {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
}

.result.error {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
}

.result h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.result p {
    margin: 5px 0;
    font-size: 1rem;
}

.result .highlight {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

footer {
    text-align: center;
    color: white;
    opacity: 0.9;
    margin-top: 40px;
    position: relative;
}

footer p {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5),
                 0 0 20px rgba(255, 215, 0, 0.3);
    animation: footer-glow 2s ease-in-out infinite;
}

@keyframes footer-glow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.5),
                     0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.8),
                     0 0 25px rgba(255, 215, 0, 0.6),
                     0 0 35px rgba(255, 192, 203, 0.4);
    }
}

@media (max-width: 768px) {
    .calculator-container {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
}
