/* Calorie Calculator Tool Styles */

/* Tool Container - Full Page Layout */
.calorie-calculator-tool {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 0;
    margin: 0;
}

.tool-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: rgb(34, 33, 33);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.tool-header h1 i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.tool-description {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0;
    line-height: 1.6;
}

/* Calculator Card */
.calculator-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Gender Tabs */
.gender-tabs {
    display: flex;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    gap: 0.5rem;
}

.gender-tab {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.gender-tab:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.gender-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Form Styles */
.calculator-form {
    margin-top: 1.5rem;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.input-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-label i {
    color: var(--primary-color);
    width: 16px;
}

.form-input, .form-select {
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
    box-sizing: border-box;
}

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

.input-hint {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Input with Toggle */
.input-with-toggle {
    display: flex;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.input-with-toggle:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-with-toggle .form-input {
    border: none;
    border-radius: 0;
    flex: 1;
}

.input-with-toggle .form-input:focus {
    box-shadow: none;
}

.toggle-btn {
    background: #f9fafb;
    border: none;
    border-left: 1px solid #e5e7eb;
    padding: 0.875rem 1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 60px;
}

.toggle-btn:hover {
    background: #f3f4f6;
}

/* Imperial Height Inputs */
.imperial-height {
    margin-top: 0.5rem;
}

.height-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.height-inputs .form-input {
    flex: 1;
    max-width: 80px;
}

.unit-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Action Controls */
.action-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.calculate-btn, .clear-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 160px;
    justify-content: center;
}

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

.calculate-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.calculate-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.clear-btn {
    background: #f3f4f6;
    color: var(--text-color);
}

.clear-btn:hover {
    background: #e5e7eb;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.5s ease-out;
}

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

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.results-header h2 i {
    color: var(--primary-color);
}

.copy-result-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-result-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.card-header i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.card-unit {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* Specific Card Colors */
.bmr-card .card-header i { color: #ef4444; }
.bmr-card .card-value { color: #ef4444; }

.tdee-card .card-header i { color: #f59e0b; }
.tdee-card .card-value { color: #f59e0b; }

.goal-card .card-header i { color: #10b981; }
.goal-card .card-value { color: #10b981; }

.bmi-card .card-header i { color: #8b5cf6; }
.bmi-card .card-value { color: #8b5cf6; }

/* Breakdown Section */
.breakdown-section, .timeline-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.breakdown-section h3, .timeline-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breakdown-section h3 i, .timeline-section h3 i {
    color: var(--primary-color);
}

.breakdown-content, .timeline-content {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1.5rem;
    line-height: 1.6;
}

/* Examples Section */
.examples-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.examples-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.examples-section h3 i {
    color: var(--primary-color);
}

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

.example-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.example-item:hover {
    background: #f0f9ff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.example-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.example-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

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

/* Related Tools Section */
.related-tools-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 900px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.related-tools-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.related-tools-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.related-tools-header h3 i {
    color: var(--primary-color);
}

.related-tools-header p {
    color: var(--text-light);
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.related-tool-link {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.related-tool-link:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, #059669 100%);
    color: #ffffff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.related-tool-link i {
    font-size: 0.875rem;
}

/* SEO Content */
.seo-content {
    background: white;
    padding: 3rem 0;
    margin-top: 2rem;
}

.seo-content .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.seo-content h2, .seo-content h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.seo-content p, .seo-content li {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.seo-content ul {
    padding-left: 1.5rem;
}

.mb-10 {
    margin-bottom: 2.5rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }

    .calculator-card, .results-section, .examples-section {
        padding: 1.5rem;
    }

    .input-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .gender-tabs {
        flex-direction: row;
        gap: 0.25rem;
        padding: 0.25rem;
    }

    .gender-tab {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    .action-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .calculate-btn, .clear-btn {
        width: 100%;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

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

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

    .height-inputs {
        justify-content: center;
    }

    /* Fix input overflow on mobile */
    .input-with-toggle {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .input-with-toggle .form-input {
        width: 100%;
        min-width: 0;
        flex: 1;
        box-sizing: border-box;
    }

    .toggle-btn {
        flex-shrink: 0;
        min-width: 60px;
        max-width: 80px;
    }

    .height-inputs .form-input {
        max-width: 70px;
        min-width: 60px;
    }
}

@media (max-width: 480px) {
    .tool-container {
        padding: 0.75rem;
    }

    .tool-header h1 {
        font-size: 1.5rem;
    }

    .calculator-card, .results-section, .examples-section {
        padding: 1rem;
    }

    .card-value {
        font-size: 1.5rem;
    }

    .input-with-toggle {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
    }

    .toggle-btn {
        border-left: none;
        border-top: 1px solid #e5e7eb;
        border-radius: 0 0 8px 8px;
        width: 100%;
        min-width: auto;
        max-width: none;
    }

    .input-with-toggle .form-input {
        border-radius: 8px 8px 0 0;
        width: 100%;
        min-width: 0;
    }

    .height-inputs {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .height-inputs .form-input {
        max-width: 80px;
        min-width: 70px;
        flex: 1;
    }

    .unit-label {
        white-space: nowrap;
    }

    .related-tools-section {
        padding: 1.5rem;
        margin: 1.5rem 1rem;
    }

    .related-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .related-tool-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.8rem;
        flex-direction: column;
        gap: 4px;
    }

    .related-tool-link i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .related-tools-section {
        padding: 1rem;
        margin: 1rem 0.75rem;
    }

    .related-tools-grid {
        grid-template-columns: 1fr;
    }

    .related-tool-link {
        flex-direction: row;
        gap: 8px;
        justify-content: flex-start;
        text-align: left;
    }
}
