/**
 * Cat Age Calculator - Premium Glassmorphism UI
 */

 @import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --cac-primary-gradient: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    --cac-accent: #fd79a8;
    --cac-text-main: #2d3436;
    --cac-text-muted: #636e72;
    --cac-glass-bg: rgba(255, 255, 255, 0.7);
    --cac-glass-border: rgba(255, 255, 255, 0.4);
    --cac-shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.05);
    --cac-shadow-strong: 0 8px 32px 0 rgba(108, 92, 231, 0.2);
}

.cac-calculator {
    max-width: 550px;
    margin: 3rem auto;
    font-family: 'Outfit', sans-serif;
    color: var(--cac-text-main);
    padding: 0 10px;
    line-height: 1.6;
}

.cac-card {
    background: var(--cac-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--cac-glass-border);
    border-radius: 32px;
    padding: 3rem 2.5rem;
    box-shadow: var(--cac-shadow-strong);
    position: relative;
    overflow: hidden;
}

/* Trang trí nền */
.cac-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: var(--cac-primary-gradient);
    filter: blur(60px);
    opacity: 0.15;
    z-index: 0;
}

.cac-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: var(--cac-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    position: relative;
    z-index: 1;
}

.cac-subtitle {
    font-size: 1.1rem;
    color: var(--cac-text-muted);
    margin-bottom: 2.5rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.cac-form {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    position: relative;
    z-index: 1;
}

.cac-input-group label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
    color: var(--cac-text-main);
    padding-left: 5px;
}

.cac-input-with-unit {
    display: flex;
    gap: 12px;
}

.cac-form input, .cac-form select {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.05);
    background: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-family: inherit;
    color: var(--cac-text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.cac-form input:focus, .cac-form select:focus {
    border-color: #6c5ce7;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.15);
    transform: translateY(-1px);
}

.cac-submit-btn {
    margin-top: 1rem;
    padding: 1.1rem;
    border-radius: 18px;
    border: none;
    background: var(--cac-primary-gradient);
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.3);
}

.cac-submit-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px rgba(108, 92, 231, 0.4);
}

.cac-submit-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Results Section */
.cac-results {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.cac-result-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.cac-human-age-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cac-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.cac-human-age-value {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--cac-text-main);
    line-height: 1;
}

.cac-human-age-value span {
    background: var(--cac-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cac-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.cac-result-item {
    background: #fff;
    padding: 1.25rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    transition: transform 0.3s ease;
}

.cac-result-item:hover {
    transform: translateY(-5px);
}

.cac-item-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cac-text-muted);
    margin-bottom: 0.4rem;
}

.cac-item-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--cac-text-main);
}

/* Life Progress Bar */
.cac-lifespan-bar-container {
    margin-bottom: 2.5rem;
    background: rgba(0,0,0,0.03);
    height: 10px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.cac-lifespan-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--cac-primary-gradient);
    border-radius: 10px;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.cac-care-tips {
    background: rgba(255, 255, 255, 0.5);
    padding: 1.5rem;
    border-radius: 24px;
    border: 1px solid var(--cac-glass-border);
}

.cac-care-tips h3 {
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cac-care-tips h3::before {
    content: '💡';
}

.cac-care-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cac-care-tips li {
    background: #fff;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--cac-secondary);
    transition: all 0.3s ease;
}

.cac-care-tips li:hover {
    transform: translateX(5px);
    background: #fafafa;
}

.cac-res-advice {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.05) 0%, rgba(162, 155, 254, 0.05) 100%);
    border-radius: 20px;
    font-size: 1rem;
    color: var(--cac-text-main);
    border: 1px solid rgba(108, 92, 231, 0.1);
    line-height: 1.7;
    font-style: italic;
    position: relative;
}

.cac-res-advice::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 3rem;
    color: rgba(108, 92, 231, 0.1);
    font-family: serif;
}

.cac-affiliate-box {
    margin-top: 2.5rem;
    background: #fff;
    border-radius: 24px;
    padding: 2rem;
    border: 2px solid var(--cac-secondary);
    box-shadow: 0 15px 35px rgba(108, 92, 231, 0.1);
    text-align: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(162, 155, 254, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(162, 155, 254, 0); }
    100% { box-shadow: 0 0 0 0 rgba(162, 155, 254, 0); }
}

.cac-aff-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--cac-primary-gradient);
    font-size: 1.25rem;
    font-weight: 800;
}

.cac-aff-content p {
    font-size: 0.95rem;
    color: var(--cac-text-muted);
    margin-bottom: 1.5rem;
}

.cac-aff-btn {
    display: inline-block;
    background: var(--cac-primary-gradient);
    color: white;
    padding: 0.85rem 1.75rem;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.2);
}

.cac-aff-btn:hover {
    transform: scale(1.05);
    color: white;
    box-shadow: 0 15px 25px rgba(108, 92, 231, 0.3);
}

/* Action Buttons in Header */
.cac-action-btns {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
}

.cac-icon-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--cac-glass-border);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cac-icon-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* Saved List */
.cac-saved-list {
    margin-top: 2rem;
}

.cac-saved-list h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--cac-text-main);
    text-align: center;
}

.cac-saved-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.cac-saved-item {
    background: var(--cac-glass-bg);
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--cac-glass-border);
    position: relative;
    text-align: center;
    animation: fadeIn 0.4s ease;
}

.cac-saved-item strong {
    display: block;
    font-size: 0.9rem;
}

.cac-saved-item span {
    font-size: 0.75rem;
    color: var(--cac-text-muted);
}

.cac-delete-cat {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: #ff7675;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

/* Toast Messenger */
.cac-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--cac-text-main);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.cac-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Mobile Tweak - Extremely Important */



@media (max-width: 500px) {
    .cac-calculator {
        margin: 1.5rem auto;
        padding: 0 8px;
    }
    .cac-card {
        padding: 2rem 1.25rem;
        border-radius: 24px;
    }
    .cac-title {
        font-size: 1.8rem;
    }
    .cac-human-age-value {
        font-size: 2.75rem;
    }
    .cac-result-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .cac-form input, .cac-form select {
        padding: 0.85rem 1rem;
    }
    .cac-care-tips {
        padding: 1.25rem 1rem;
    }
}

