/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Artistic Background Elements */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
        radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 100px 100px, 50px 50px;
    animation: float 20s infinite linear;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        conic-gradient(from 0deg at 20% 30%, transparent 0deg, rgba(120, 119, 198, 0.1) 60deg, transparent 120deg),
        conic-gradient(from 180deg at 80% 70%, transparent 0deg, rgba(255, 119, 198, 0.1) 90deg, transparent 180deg);
    pointer-events: none;
    z-index: 0;
}

/* Floating geometric shapes */
.container::before {
    content: '';
    position: absolute;
    top: 10%;
    right: 15%;
    width: 150px;
    height: 150px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morph 8s infinite ease-in-out, float-gentle 6s infinite ease-in-out;
    pointer-events: none;
}

.container::after {
    content: '';
    position: absolute;
    bottom: 20%;
    left: 10%;
    width: 120px;
    height: 120px;
    background: linear-gradient(-45deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
    animation: morph 10s infinite ease-in-out reverse, float-gentle 8s infinite ease-in-out reverse;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 15px;
    text-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
}

.title i {
    font-size: 2.5rem;
    color: #ffd700;
    animation: pulse 2s infinite;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.calculator-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    box-shadow: 
        0 25px 70px rgba(102, 126, 234, 0.2),
        0 10px 40px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    padding: 40px;
    width: 100%;
    max-width: 800px;
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}

.calculator-card::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    border-radius: 23px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

/* Input Section */
.input-section {
    margin-bottom: 40px;
    text-align: center;
}

.input-section h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 30px;
    font-weight: 600;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.input-wrapper label {
    font-weight: 500;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.input-wrapper label i {
    color: #667eea;
}

.date-input {
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafafa;
    color: #333;
}

.date-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

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

/* Results Section */
.results-section {
    display: none;
    animation: fadeInUp 0.6s ease-out;
}

.results-section.show {
    display: block;
}

.results-section h3 {
    text-align: center;
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 30px;
    font-weight: 600;
}

.age-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.age-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
    border: 2px solid #e1e5e9;
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.age-card.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
}

.age-card:hover:not(.primary) {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.age-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: inherit;
}

.age-card.primary .age-number {
    color: white;
}

.age-unit {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Detailed Info */
.detailed-info {
    margin-bottom: 40px;
}

.detailed-info h4 {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9ff;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.info-item:hover {
    background: #f0f2ff;
    transform: translateX(5px);
}

.info-label {
    font-weight: 500;
    color: #555;
}

.info-value {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

/* Fun Facts */
.fun-facts h4 {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
}

.fun-facts h4 i {
    color: #ffd700;
    margin-right: 8px;
}

.fact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fact-item {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe6cc 100%);
    padding: 15px 20px;
    border-radius: 12px;
    border-left: 4px solid #ffd700;
    font-weight: 500;
    color: #663d00;
    position: relative;
    overflow: hidden;
}

.fact-item::before {
    content: '💫';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.footer p:first-child {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.footer strong {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    font-size: 1.2rem;
}

.footer-subtitle {
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 400;
}

.footer i {
    color: #ff6b6b;
    animation: heartbeat 1.5s infinite;
    filter: drop-shadow(0 0 5px rgba(255, 107, 107, 0.3));
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

@keyframes float {
    0% {
        transform: translateX(0px) translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateX(30px) translateY(-30px) rotate(120deg);
    }
    66% {
        transform: translateX(-20px) translateY(20px) rotate(240deg);
    }
    100% {
        transform: translateX(0px) translateY(0px) rotate(360deg);
    }
}

@keyframes morph {
    0%, 100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: rotate(0deg);
    }
    25% {
        border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
        transform: rotate(90deg);
    }
    50% {
        border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
        transform: rotate(180deg);
    }
    75% {
        border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
        transform: rotate(270deg);
    }
}

@keyframes float-gentle {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    50% {
        transform: translateY(-20px) translateX(10px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: 2.2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .title i {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .calculator-card {
        padding: 25px 20px;
        margin: 10px;
    }
    
    .age-display {
        grid-template-columns: 1fr;
    }
    
    .age-card.primary {
        transform: none;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .date-input-group {
        gap: 20px;
    }
    
    .input-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }
    
    .calculator-card {
        padding: 20px 15px;
    }
    
    .age-number {
        font-size: 2rem;
    }
    
    .info-item {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
}