/* ============================================
   Variable Definitions
   ============================================ */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f5f5f5;
    --white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* ============================================
   Header Styles
   ============================================ */
.header {
    text-align: center;
    color: var(--white);
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title-icon {
    font-size: 2.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ============================================
   Bookmark Banner
   ============================================ */
.bookmark-banner {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.5s ease;
}

.bookmark-banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bookmark-banner-icon {
    font-size: 1.5rem;
}

.bookmark-banner-text {
    flex: 1;
    color: var(--text-color);
}

.bookmark-banner-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.bookmark-banner-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.bookmark-banner-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ============================================
   Calculator Card
   ============================================ */
.calculator-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease;
}

.input-section {
    margin-bottom: 20px;
}

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

.input-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-icon {
    font-size: 1.2rem;
}

/* ============================================
   Input Styles
   ============================================ */
.number-input,
.select-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.number-input:focus,
.select-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Gender Buttons */
.gender-buttons {
    display: flex;
    gap: 10px;
}

.gender-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    background: var(--white);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.gender-btn:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

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

/* Unit Toggle */
.unit-toggle {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.unit-btn {
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    background: var(--white);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

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

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

.height-input-group {
    margin-top: 10px;
}

.imperial-inputs {
    display: flex;
    gap: 10px;
}

.imperial-inputs .number-input {
    flex: 1;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    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;
    margin-top: 10px;
    font-family: inherit;
    box-shadow: var(--shadow-md);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-icon {
    font-size: 1.2rem;
}

/* ============================================
   Results Section
   ============================================ */
.results-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
    animation: fadeIn 0.6s ease;
}

.results-section.hidden {
    display: none;
}

.results-header {
    margin-bottom: 25px;
}

.results-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
}

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

.result-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: var(--border-radius);
    padding: 25px;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.result-card.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
}

.result-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.result-label {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
}

.result-description {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 5px;
}

/* ============================================
   Calorie Targets Section
   ============================================ */
.calorie-targets-section {
    margin-top: 30px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 20px;
    text-align: center;
}

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

.target-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    border: 2px solid #e0e0e0;
    transition: var(--transition);
}

.target-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.target-card.loss {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
}

.target-card.mild-loss {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.target-card.maintenance {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.target-card.mild-gain {
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.target-card.gain {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.target-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.target-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
}

.target-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 5px;
}

.target-description {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ============================================
   AI Features Section
   ============================================ */
.ai-features-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

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

.ai-feature-btn {
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-family: inherit;
}

.ai-feature-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
}

.ai-icon {
    font-size: 2.5rem;
}

.ai-text {
    font-size: 1rem;
    font-weight: 600;
}

.ai-result-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.ai-result-section.hidden {
    display: none;
}

.ai-content {
    background: #f9f9f9;
    border-radius: var(--border-radius);
    padding: 25px;
    line-height: 1.8;
}

/* ============================================
   Recent Queries
   ============================================ */
.recent-queries-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.recent-queries-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.recent-query-item {
    padding: 8px 15px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.recent-query-item:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* ============================================
   Features Section
   ============================================ */
.features-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.features-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-color);
}

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

.feature-item {
    text-align: center;
    padding: 20px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-5px);
    background: rgba(102, 126, 234, 0.05);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.feature-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
}

/* ============================================
   Content Section
   ============================================ */
.content-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.content-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-color);
}

.content-text {
    color: var(--text-light);
    line-height: 1.8;
}

.content-text h3 {
    color: var(--text-color);
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.content-text p {
    margin-bottom: 15px;
}

.content-list {
    margin-left: 20px;
    margin-bottom: 20px;
}

.content-list li {
    margin-bottom: 10px;
}

/* ============================================
   FAQ Section
   ============================================ */
.faq-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.faq-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-color);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-item {
    padding: 20px;
    background: #f9f9f9;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.faq-answer {
    color: var(--text-light);
    line-height: 1.7;
}

/* ============================================
   Floating Navigation
   ============================================ */
.floating-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--white);
    border-radius: 16px;
    padding: 20px 15px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    min-width: 140px;
    max-width: 160px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.floating-nav-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.nav-icon {
    font-size: 1.2rem;
}

.nav-title {
    font-size: 0.9rem;
}

.floating-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.floating-nav-list li {
    margin: 0;
    padding: 0;
}

.nav-link {
    display: block;
    padding: 10px 12px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
    text-align: center;
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    transform: translateX(-3px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    font-weight: 500;
    box-shadow: var(--shadow-md);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 0 2px 2px 0;
}

/* Hide floating nav on mobile and tablet */
@media (max-width: 1024px) {
    .floating-nav {
        display: none !important;
    }
}

/* ============================================
   Feedback Section
   ============================================ */
.feedback-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-top: 30px;
    margin-bottom: 30px;
}

.feedback-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feedback-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 1rem;
}

.feedback-form {
    max-width: 600px;
    margin: 0 auto;
}

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

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: #f9f9f9;
    resize: vertical;
}

.form-textarea {
    min-height: 120px;
    line-height: 1.6;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: var(--white);
}

.feedback-submit-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    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;
    box-shadow: var(--shadow-md);
    margin-top: 10px;
    font-family: inherit;
}

.feedback-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.feedback-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.feedback-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.feedback-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.feedback-message-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--white);
}

.feedback-message-error {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: var(--white);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    text-align: center;
    color: var(--white);
    padding: 30px 20px;
    opacity: 0.9;
}

.footer-links {
    margin-top: 10px;
}

.footer-link {
    color: var(--white);
    text-decoration: none;
    margin: 0 10px;
    transition: var(--transition);
}

.footer-link:hover {
    text-decoration: underline;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .title {
        font-size: 2rem;
    }

    .title-icon {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .calculator-card {
        padding: 20px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .targets-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ai-features-grid {
        grid-template-columns: 1fr;
    }

    .content-section,
    .faq-section,
    .feedback-section {
        padding: 25px;
    }

    .feedback-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 10px;
    }

    .targets-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .imperial-inputs {
        flex-direction: column;
    }

    .content-section,
    .faq-section,
    .feedback-section {
        padding: 20px;
    }

    .feedback-title {
        font-size: 1.3rem;
    }
}

