/* Main Styles for CalcHub */

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    position: relative;
}

/* 3D Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.background-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(125deg, #330867, #30cfd0);
    opacity: 0.3;
}

.background-animation::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, transparent 20%, #330867 80%);
    transform: translate(-50%, -50%);
    animation: pulse 15s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.3;
    }
}

/* Floating Particles */
.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    animation: float 15s infinite;
    z-index: 1;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-1000px) rotate(720deg);
        opacity: 0;
    }
}

/* 3D Category Icons */
.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    position: relative;
    transform-style: preserve-3d;
    animation: rotate3d 8s infinite linear;
    border-radius: 50%;
}

@keyframes rotate3d {
    0% {
        transform: rotateY(0deg) rotateX(0deg);
    }
    100% {
        transform: rotateY(360deg) rotateX(360deg);
    }
}

/* Mathematics Icon */
.mathematics-icon {
    background: linear-gradient(45deg, #ff9a9e, #fad0c4);
    box-shadow: 0 0 20px rgba(255, 154, 158, 0.7);
}

.mathematics-icon::before {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
}

/* Finance Icon */
.finance-icon {
    background: linear-gradient(45deg, #84fab0, #8fd3f4);
    box-shadow: 0 0 20px rgba(132, 250, 176, 0.7);
}

.finance-icon::before {
    content: '$';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
}

/* Health Icon */
.health-icon {
    background: linear-gradient(45deg, #a18cd1, #fbc2eb);
    box-shadow: 0 0 20px rgba(161, 140, 209, 0.7);
}

.health-icon::before {
    content: '♥';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
}

/* Conversion Icon */
.conversion-icon {
    background: linear-gradient(45deg, #ffecd2, #fcb69f);
    box-shadow: 0 0 20px rgba(255, 236, 210, 0.7);
}

.conversion-icon::before {
    content: '⇄';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
}

/* Utilities Icon */
.utilities-icon {
    background: linear-gradient(45deg, #ff9a9e, #fecfef);
    box-shadow: 0 0 20px rgba(255, 154, 158, 0.7);
}

.utilities-icon::before {
    content: '⚙';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
}

/* Featured Icon */
.featured-icon {
    background: linear-gradient(45deg, #f6d365, #fda085);
    box-shadow: 0 0 20px rgba(246, 211, 101, 0.7);
}

.featured-icon::before {
    content: '★';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
}

/* Feature Icons */
.feature-icon {
    width: 60px;
    height: 60px;
    position: relative;
    transform-style: preserve-3d;
    animation: float3d 5s infinite ease-in-out;
    border-radius: 50%;
}

@keyframes float3d {
    0%, 100% {
        transform: translateY(0) rotateY(0deg);
    }
    50% {
        transform: translateY(-10px) rotateY(180deg);
    }
}

.accuracy-icon {
    background: linear-gradient(45deg, #00f2fe, #4facfe);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.7);
}

.accuracy-icon::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

.user-friendly-icon {
    background: linear-gradient(45deg, #f093fb, #f5576c);
    box-shadow: 0 0 20px rgba(240, 147, 251, 0.7);
}

.user-friendly-icon::before {
    content: '☺';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

.responsive-icon {
    background: linear-gradient(45deg, #5ee7df, #b490ca);
    box-shadow: 0 0 20px rgba(94, 231, 223, 0.7);
}

.responsive-icon::before {
    content: '📱';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

.free-icon {
    background: linear-gradient(45deg, #43e97b, #38f9d7);
    box-shadow: 0 0 20px rgba(67, 233, 123, 0.7);
}

.free-icon::before {
    content: '🎁';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

/* Calculator Container Styles */
.calculator-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.calculator-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.5);
}

/* Button Styles */
.calc-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-weight: bold;
    transition: all 0.3s ease;
}

.calc-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.calc-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Input Styles */
.calc-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    transition: all 0.3s ease;
}

.calc-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Result Display Styles */
.result-display {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 1rem;
    color: white;
    font-size: 1.5rem;
    text-align: right;
    margin-bottom: 1rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .category-icon, .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .category-icon::before, .feature-icon::before {
        font-size: 1.8rem;
    }
    
    .calculator-container {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .category-icon, .feature-icon {
        width: 50px;
        height: 50px;
    }
    
    .category-icon::before, .feature-icon::before {
        font-size: 1.5rem;
    }
    
    .calculator-container {
        padding: 1rem;
    }
}

/* Animation for calculator buttons */
@keyframes buttonPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.calc-btn:active {
    animation: buttonPop 0.2s ease;
}

/* Tool page specific styles */
.tool-header {
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.tool-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 4px;
    background: linear-gradient(to right, #ff9a9e, #fad0c4);
    border-radius: 2px;
}

.tool-description {
    margin-bottom: 2rem;
    line-height: 1.6;
}

.faq-item {
    margin-bottom: 1.5rem;
}

.faq-question {
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.faq-question::before {
    content: 'Q:';
    margin-right: 0.5rem;
    color: #ff9a9e;
    font-weight: bold;
}

.faq-answer {
    padding-left: 1.5rem;
}

/* Ad placement styles */
.ad-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    margin: 2rem 0;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

.ad-container p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}