/* ===== RESET AND BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #4cc9f0;
    --success-color: #4ade80;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --gray-color: #64748b;
    --border-radius: 12px;
    --box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark-color);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ===== HEADER ===== */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.logo i {
    font-size: 2.8rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.2rem;
    color: var(--gray-color);
    font-weight: 400;
    margin-top: 10px;
}

/* ===== CALCULATOR CARD ===== */
.calculator-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    margin-bottom: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* ===== INPUT SECTION ===== */
.input-section h2, .result-section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-section h2 i, .result-section h2 i {
    color: var(--primary-color);
}

.date-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group label i {
    color: var(--primary-color);
}

.input-group input, .input-group select {
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
    background-color: white;
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.input-group input::placeholder {
    color: #94a3b8;
}

.error {
    color: var(--danger-color);
    font-size: 0.9rem;
    min-height: 20px;
    margin-top: 5px;
}

/* ===== BUTTONS ===== */
.button-container {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    padding: 16px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
    font-family: 'Poppins', sans-serif;
}

.calculate {
    background-color: var(--primary-color);
    color: white;
}

.calculate:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3);
}

.reset {
    background-color: #f1f5f9;
    color: var(--dark-color);
}

.reset:hover {
    background-color: #e2e8f0;
    transform: translateY(-3px);
}

/* ===== RESULT SECTION ===== */
.result-section {
    display: flex;
    flex-direction: column;
}

.result-display {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.age-result {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.result-box {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    border-radius: 10px;
    padding: 25px 15px;
    text-align: center;
    border: 2px solid rgba(67, 97, 238, 0.1);
    transition: var(--transition);
}

.result-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(67, 97, 238, 0.1);
}

.result-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 10px;
}

.result-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-color);
}

.total-days, .zodiac-sign, .next-birthday {
    background-color: #f8fafc;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 15px;
    border-left: 5px solid var(--primary-color);
}

.total-days p, .zodiac-sign p, .next-birthday p {
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.total-days i, .zodiac-sign i, .next-birthday i {
    color: var(--primary-color);
    width: 24px;
}

.total-days span, .zodiac-sign span, .next-birthday span {
    font-weight: 600;
    color: var(--primary-color);
}

.next-birthday p:last-child {
    margin-bottom: 0;
}

/* ===== INFO SECTION ===== */
.info-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.info-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    text-align: center;
}

.info-card:hover {
    transform: translateY(-10px);
}

.info-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.info-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.info-card p {
    color: var(--gray-color);
    line-height: 1.6;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 25px;
    color: var(--gray-color);
    border-top: 1px solid #e2e8f0;
}

footer p {
    margin-bottom: 10px;
}

footer i.fa-heart {
    color: var(--danger-color);
    margin: 0 5px;
}

.footer-note {
    font-size: 0.9rem;
    color: #94a3b8;
}

#current-year {
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* =========================================== */
/* ========== RESPONSIVE FIXES BELOW ========= */
/* =========================================== */

/* Tablet (768px to 1023px) */
@media (max-width: 1023px) {
    .calculator-card {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 25px;
    }
    
    .info-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .logo h1 {
        font-size: 2.2rem;
    }
    
    .tagline {
        font-size: 1.1rem;
    }
}

/* Large Mobile (576px to 767px) */
@media (max-width: 767px) {
    body {
        padding: 15px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo i {
        font-size: 2.2rem;
    }
    
    .input-section h2, .result-section h2 {
        font-size: 1.5rem;
    }
    
    .date-inputs {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .age-result {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .result-number {
        font-size: 2.5rem;
    }
    
    .button-container {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* Small Mobile (up to 575px) */
@media (max-width: 575px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 15px 0;
        margin-bottom: 25px;
    }
    
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .tagline {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .calculator-card {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .input-section h2, .result-section h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .date-inputs {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .input-group input, .input-group select {
        padding: 14px;
        font-size: 1rem;
    }
    
    .age-result {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .result-box {
        padding: 20px 10px;
    }
    
    .result-number {
        font-size: 2.2rem;
    }
    
    .result-label {
        font-size: 1rem;
    }
    
    .total-days, .zodiac-sign, .next-birthday {
        padding: 15px;
    }
    
    .total-days p, .zodiac-sign p, .next-birthday p {
        font-size: 1rem;
    }
    
    .info-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .info-card {
        padding: 20px;
    }
    
    .info-card i {
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .info-card h3 {
        font-size: 1.3rem;
    }
    
    footer {
        padding: 20px 15px;
    }
    
    footer p {
        font-size: 0.9rem;
    }
}

/* Very Small Mobile (up to 375px) */
@media (max-width: 375px) {
    .logo h1 {
        font-size: 1.6rem;
    }
    
    .input-section h2, .result-section h2 {
        font-size: 1.2rem;
    }
    
    .result-number {
        font-size: 2rem;
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 1rem;
    }
}

/* Landscape Mode Fixes */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 10px;
    }
    
    header {
        margin-bottom: 20px;
        padding: 10px 0;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .tagline {
        display: none;
    }
    
    .calculator-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .info-section {
        display: none;
    }
}

/* Prevent zoom on iOS input focus */
@media (max-width: 767px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Ensure buttons are touch-friendly on mobile */
@media (max-width: 767px) {
    .btn {
        min-height: 50px;
    }
    
    .input-group input, .input-group select {
        min-height: 50px;
    }
}

/* Fix for foldable phones */
@media (max-width: 350px) {
    .container {
        padding: 0 5px;
    }
    
    .calculator-card {
        padding: 15px;
    }
    
    .result-number {
        font-size: 1.8rem;
    }
}
