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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* Container Styles */
.container {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    width: 90%;
    max-width: 500px;
    margin-top: 2rem;
    margin-bottom: 0;
}

/* Typography */
h1 {
    color: #1a1a1a;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

h2 {
    color: #2c3e50;
    font-size: 1.25rem;
    margin: 1.5rem 0;
    font-weight: 600;
}

/* Form Elements */
#calculator-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

label {
    color: #4a5568;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    display: block;
}

select, input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: #f8fafc;
}

select:focus, input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Height Input Specific Styles */
.height-input {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.height-input select {
    flex: 1;
}

.height-input span {
    color: #64748b;
    font-size: 0.9rem;
    min-width: 30px;
}

/* Button Styles */
#calculate-btn {
    background: #3b82f6;
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

#calculate-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

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

/* Results Section */
#results {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f1f5f9;
}

#results p {
    color: #1e293b;
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

/* Toggle Switch Styles */
.unit-toggle {
    position: relative;
    background: white;
    padding: 1.2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
}

.toggle-wrapper {
    display: flex;
    justify-content: center;
}

.toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    user-select: none;
}

.toggle-track {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 32px;
    background-color: #e2e8f0;
    border-radius: 32px;
    transition: all 0.3s ease;
}

.toggle-indicator {
    position: absolute;
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.toggle-text {
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.toggle-text.metric {
    color: #94a3b8;
}

.toggle-text.imperial {
    color: #94a3b8;
}

/* Active States */
.toggle-input:checked + .toggle-label .toggle-track {
    background-color: #3b82f6;
}

.toggle-input:checked + .toggle-label .toggle-indicator {
    transform: translateX(32px);
}

.toggle-input:checked + .toggle-label .toggle-text.metric {
    color: #1e293b;
}

.toggle-input:not(:checked) + .toggle-label .toggle-text.imperial {
    color: #1e293b;
}

/* Hover States */
.toggle-label:hover .toggle-track {
    background-color: #cbd5e1;
}

.toggle-input:checked + .toggle-label:hover .toggle-track {
    background-color: #2563eb;
}

/* Focus States for accessibility */
.toggle-input:focus + .toggle-label .toggle-track {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Animation for the text */
@keyframes fadeIn {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

.toggle-text {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .toggle-text {
        font-size: 0.85rem;
    }
    
    .toggle-track {
        width: 56px;
        height: 28px;
    }
    
    .toggle-indicator {
        height: 20px;
        width: 20px;
    }
    
    .toggle-input:checked + .toggle-label .toggle-indicator {
        transform: translateX(28px);
    }
}

/* Loading and Animation States */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#results {
    animation: fadeIn 0.3s ease-out;
}

.container {
    animation: fadeIn 0.4s ease-out;
}

/* Update the footer styles */
.footer {
    width: 100%;
    padding: 2rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    background: transparent;
}

.footer-links {
    font-size: 0.8rem;
    padding: 0.5rem;
}

.footer-links a {
    color: #4a5568;
    text-decoration: none;
    padding: 0 0.5rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #2d3748;
}

.footer-link {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-block;
    width: auto;
}

.footer-link:hover {
    color: #3b82f6;
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
}

.footer-link:active {
    transform: translateY(0);
}

/* Content Styles for Privacy and Terms pages */
.content {
    line-height: 1.6;
    color: #4a5568;
}

.content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2d3748;
}

.content p {
    margin-bottom: 1rem;
}

.last-updated {
    color: #718096;
    font-style: italic;
    margin-bottom: 2rem;
}

.back-to-home {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f1f5f9;
}

.back-to-home a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.back-to-home a:hover {
    color: #2563eb;
    transform: translateX(-4px);
}

/* Scroll Indicator */
.scroll-indicator {
    text-align: center;
    margin: 1rem 0;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.scroll-indicator:hover {
    opacity: 1;
}

#scrollButton {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #64748b;
    transition: all 0.3s ease;
}

#scrollButton:hover {
    color: #3b82f6;
    transform: translateY(4px);
}

#scrollButton svg {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-6px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* Content Section */
.content-section {
    width: 100%;
    padding: 4rem 1rem;
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.content-section h2 {
    text-align: center;
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 3rem;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.content-card {
    background: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.content-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
}

.content-card h3 {
    color: #2d3748;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-card p {
    color: #64748b;
    line-height: 1.6;
}

/* Optional: Add subtle animation to the cards */
.content-card {
    animation: cardFloat 8s ease-in-out infinite;
    animation-delay: calc(var(--card-index, 0) * 0.2s);
}

@keyframes cardFloat {
    0%, 100% { 
        transform: translateY(0); 
    }
    50% { 
        transform: translateY(-8px); 
    }
}

/* FAQ Section Styles */
.faq-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.faq-section h2 {
    text-align: center;
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 3rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.faq-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
}

.faq-item h3 {
    color: #2d3748;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    flex: 0 0 auto;
}

.faq-item p {
    color: #4a5568;
    line-height: 1.6;
    font-size: 1rem;
    margin: 0;
    flex: 1;
}

/* Responsive adjustments for FAQ */
@media (min-width: 768px) {
    .faq-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .faq-item:nth-child(odd) {
        transform: none;
    }
    
    .faq-item:hover {
        transform: translateY(-2px);
    }
}