:root {
    --primary-color: #4a6fa5;
    --secondary-color: #ff7e5f;
    --light-bg: #f8f9fa;
    --dark-bg: #2c3e50;
    --light-text: #333;
    --dark-text: #eee;
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-bg);
    color: var(--light-text);
    transition: var(--transition);
    line-height: 1.6;
}

body.dark-mode {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Ensure content-wrapper doesn't limit the footer width */
.content-wrapper {
    display: flex;
    justify-content: center;
    flex-grow: 1;
    align-items: flex-start;
    padding: 20px 0;
    width: 100%;
    max-width: 100%;
}

.container {
    max-width: 800px;
    margin: 0 20px;
    padding: 30px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

body.dark-mode .container {
    background-color: #3a4a5d;
}

/* Hero Section */
.hero-section {
    background-color: var(--primary-color);
    color: rgb(134, 112, 222);
    padding: 60px 0 40px;
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

body.dark-mode .hero-section {
    background-color: #3a5a8f;
}

.hero-content {
    max-width: 800px;
    width: 100%;
    padding: 0 20px;
    margin: 0 auto;
}

.hero-image {
    width: 50px;
    height: 50px;
    margin-bottom: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-top: 10px;
    opacity: 0.9;
}

.subtitle {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
    font-size: 1.1rem;
}

body.dark-mode .subtitle {
    color: #aaa;
}

/* Section Styling */
.calculator-section {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}

body.dark-mode .calculator-section {
    background-color: rgba(58, 74, 97, 0.5);
}

.selection-container {
    margin-bottom: 30px;
    padding: 20px;
    background-color: rgba(74, 111, 165, 0.05);
    border-radius: 8px;
    transition: var(--transition);
}

body.dark-mode .selection-container {
    background-color: rgba(74, 111, 165, 0.1);
}

.selection-container h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.pet-options, .size-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.pet-option, .size-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 15px;
    border-radius: 8px;
    transition: var(--transition);
    width: 120px;
}

.pet-option:hover, .size-option:hover {
    background-color: rgba(74, 111, 165, 0.1);
    transform: translateY(-3px);
}

.pet-option.selected, .size-option.selected {
    background-color: rgba(74, 111, 165, 0.2);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.pet-image, .size-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
    transition: var(--transition);
}

.pet-option.selected .pet-image, 
.size-option.selected .size-image {
    transform: scale(1.1);
}

.pet-option span, .size-option span {
    text-align: center;
    font-weight: 500;
}

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

.age-input-container {
    display: flex;
    gap: 10px;
}

input[type="number"] {
    flex: 2;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: var(--transition);
}

select {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
    transition: var(--transition);
}

body.dark-mode input[type="number"],
body.dark-mode select {
    background-color: #4a5568;
    border-color: #555;
    color: var(--dark-text);
}

button {
    background-color: var(--primary-color);
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

button:hover {
    background-color: #3a5a8f;
    transform: translateY(-2px);
}

#result {
    margin-top: 30px;
    transition: var(--transition);
}

#result.hidden {
    opacity: 0;
    height: 0;
    margin: 0;
    overflow: hidden;
}

.result-card {
    background-color: rgba(74, 111, 165, 0.1);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

body.dark-mode .result-card {
    background-color: rgba(74, 111, 165, 0.2);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.result-header img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

#result-title {
    margin: 0;
    color: var(--primary-color);
}

#result-age {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 5px 0 0;
}

.life-stage {
    margin-top: 20px;
}

.stage-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    position: relative;
}

.stage-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #ddd;
    z-index: 1;
    transform: translateY(-50%);
}

.stage {
    padding: 8px 12px;
    background-color: #ddd;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    position: relative;
    z-index: 2;
    transition: var(--transition);
}

.stage.active {
    background-color: var(--secondary-color);
    color: white;
    transform: scale(1.1);
}

#stage-description {
    font-style: italic;
    color: #666;
    margin-top: 10px;
}

body.dark-mode #stage-description {
    color: #aaa;
}

#info-section {
    margin-top: 40px;
    transition: var(--transition);
}

.info-tabs {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: var(--transition);
}

body.dark-mode .tab-button {
    color: #aaa;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.faq-item {
    margin-bottom: 15px;
}

.faq-question {
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    padding: 10px;
    background-color: rgba(74, 111, 165, 0.05);
    border-radius: 6px;
    transition: var(--transition);
}

body.dark-mode .faq-question {
    background-color: rgba(74, 111, 165, 0.1);
}

.faq-question:hover {
    background-color: rgba(74, 111, 165, 0.1);
}

body.dark-mode .faq-question:hover {
    background-color: rgba(74, 111, 165, 0.2);
}

.faq-answer {
    padding: 10px 10px 10px 20px;
    margin-top: 5px;
    border-left: 3px solid var(--primary-color);
    display: none;
}

.faq-answer p {
    margin-bottom: 10px;
}

.faq-answer ul {
    padding-left: 20px;
    margin: 10px 0;
}

.chart-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
}

th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

th {
    background-color: rgba(74, 111, 165, 0.1);
    font-weight: 600;
}

body.dark-mode th {
    background-color: rgba(74, 111, 165, 0.2);
}

.chart-note {
    font-style: italic;
    font-size: 0.9rem;
    margin-top: 10px;
    color: #666;
}

body.dark-mode .chart-note {
    color: #aaa;
}

/* Bootstrap Table Overrides */
.table {
    margin-top: 20px;
}

.table th {
    background-color: var(--primary-color);
    color: white;
}

body.dark-mode .table th {
    background-color: #3a5a8f;
}

/* Accordion styling */
.accordion-button:not(.collapsed) {
    background-color: rgba(74, 111, 165, 0.1);
    color: var(--primary-color);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(74, 111, 165, 0.25);
}

/* Footer Styles */
.footer {
    background-color: rgba(74, 111, 165, 0.1);
    padding: 40px 0 20px;
    color: #555;
    transition: var(--transition);
    width: 100%;
    display: flex;
    justify-content: center;
}

.footer .container {
    max-width: 1200px; /* Wider container for footer content */
}

body.dark-mode .footer {
    background-color: rgba(74, 111, 165, 0.2);
    color: #aaa;
}

.footer-section {
    margin-bottom: 30px;
}

.footer-section h5 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-links {
    list-style: none;
    padding-left: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #555;
    text-decoration: none;
    transition: color 0.2s;
}

body.dark-mode .footer-links a {
    color: #aaa;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.social-icons {
    margin-top: 20px;
}

.social-icons a {
    color: #555;
    margin-right: 15px;
    font-size: 1.2rem;
    transition: color 0.2s;
}

body.dark-mode .social-icons a {
    color: #aaa;
}

.social-icons a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    font-size: 0.9rem;
    width: 100%;
}

body.dark-mode .footer-bottom {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Theme Toggle */
#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    padding: 10px;
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#theme-toggle:hover {
    background-color: #3a5a8f;
    transform: scale(1.1);
}

/* Icon additions */
h2 i {
    margin-right: 10px;
    color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .hero-section {
        padding: 40px 0 20px;
    }
    
    .hero-image {
        width: 80px;
    }
    
    .pet-options, .size-options {
        flex-direction: column;
        align-items: center;
    }
    
    .age-input-container {
        flex-direction: column;
    }
    
    .result-header {
        flex-direction: column;
        text-align: center;
    }
    
    .stage-indicator {
        flex-wrap: wrap;
        gap: 5px;
        justify-content: center;
    }
    
    .stage-indicator::before {
        display: none;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .social-icons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 0 10px;
        padding: 15px;
    }
    
    .tab-buttons {
        flex-wrap: wrap;
    }
    
    .tab-button {
        flex: 1 0 auto;
    }
}

/* Privacy and Terms Page Styles */
.privacy-content, .terms-content {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}

body.dark-mode .privacy-content,
body.dark-mode .terms-content {
    background-color: rgba(58, 74, 97, 0.5);
}

.last-updated {
    text-align: right;
    font-style: italic;
    margin-bottom: 20px;
    color: #666;
}

body.dark-mode .last-updated {
    color: #aaa;
}

.privacy-content h2,
.terms-content h2 {
    margin-top: 30px;
    color: var(--primary-color);
}

.privacy-content h3,
.terms-content h3 {
    margin-top: 20px;
    color: var(--primary-color);
}

/* Ad container styles */
.ad-container {
    margin: 30px 0;
    text-align: center;
}

.ad-placeholder {
    border: 1px dashed #ccc;
    padding: 20px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.5);
}

body.dark-mode .ad-placeholder {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #555;
}

/* Contact Page Styles */
.contact-content {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}

body.dark-mode .contact-content {
    background-color: rgba(58, 74, 97, 0.5);
}

.contact-methods {
    margin-top: 30px;
}

.contact-method {
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
}

.contact-method i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 15px;
    margin-top: 5px;
}

.contact-method h4 {
    margin-bottom: 5px;
    color: var(--primary-color);
}

.contact-form {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

body.dark-mode .contact-form {
    background-color: rgba(58, 74, 97, 0.6);
}

.faq-section {
    margin-top: 40px;
}

/* Form styles */
.form-control, .form-select {
    background-color: white;
    border: 1px solid #ddd;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #4a5568;
    border-color: #555;
    color: var(--dark-text);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #3a5a8f;
    border-color: #3a5a8f;
}