/**
 * BMR Calculator Tool - Professional Styles
 * Modern, responsive design with comprehensive styling
 */

:root {
    --bmr-primary: #3b82f6;
    --bmr-primary-dark: #2563eb;
    --bmr-secondary: #64748b;
    --bmr-success: #10b981;
    --bmr-warning: #f59e0b;
    --bmr-danger: #ef4444;
    --bmr-info: #06b6d4;
    --bmr-light: #f8fafc;
    --bmr-dark: #1e293b;
    --bmr-border: #e2e8f0;
    --bmr-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --bmr-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --bmr-radius: 12px;
    --bmr-radius-lg: 16px;
    --bmr-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon Spacing - Global rules for BMR calculator */
.bmr-hero-section i,
.bmr-tool-main i,
.bmr-card-header i,
.bmr-label i,
.bmr-btn i,
.bmr-result-label i,
.bmr-goal-label i {
    margin-right: 0.5rem;
}

/* Ensure icons at the end don't have right margin */
.bmr-hero-section i:last-child,
.bmr-tool-main i:last-child,
.bmr-card-header i:last-child,
.bmr-label i:last-child,
.bmr-btn i:last-child,
.bmr-result-label i:last-child,
.bmr-goal-label i:last-child {
    margin-right: 0;
}

/* Hero Section */
.bmr-hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.bmr-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="60" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.bmr-hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    background: linear-gradient(45deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    position: relative;
    z-index: 1;
}

.bmr-hero-description {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Main Layout */
.bmr-tool-main {
    padding: 3rem 0;
    background: linear-gradient(to bottom, var(--bmr-light), #ffffff);
    /* Remove min-height that conflicts with flexbox layout */
}

.bmr-tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.bmr-tool-card {
    background: white;
    border-radius: var(--bmr-radius-lg);
    padding: 2rem;
    box-shadow: var(--bmr-shadow-lg);
    border: 1px solid var(--bmr-border);
    transition: var(--bmr-transition);
    position: relative;
    overflow: hidden;
}

.bmr-tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--bmr-primary), var(--bmr-info));
}

.bmr-tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Card Headers */
.bmr-card-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bmr-light);
}

.bmr-card-header h2 {
    color: var(--bmr-dark);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

/* Add spacing for icons in card headers */
.bmr-card-header h2 i,
.bmr-card-header h2 .fas,
.bmr-card-header h2 .far,
.bmr-card-header h2 .fab {
    margin-right: 0.5rem;
}

.bmr-card-header p {
    color: var(--bmr-secondary);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Form Styling */
.bmr-input-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bmr-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bmr-label {
    font-weight: 600;
    color: var(--bmr-dark);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

/* Add spacing between icons and text */
.bmr-label i,
.bmr-label .fas,
.bmr-label .far,
.bmr-label .fab {
    margin-right: 0.5rem;
}

/* Bootstrap utility class for margin-end */
.me-2 {
    margin-right: 0.5rem !important;
}

.bmr-form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--bmr-border);
    border-radius: var(--bmr-radius);
    font-size: 1rem;
    transition: var(--bmr-transition);
    background: white;
    color: var(--bmr-dark);
}

.bmr-form-control:focus {
    outline: none;
    border-color: var(--bmr-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.bmr-form-control:hover {
    border-color: var(--bmr-primary);
}

.bmr-form-control::placeholder {
    color: var(--bmr-secondary);
}

/* Input with Select */
.bmr-input-with-select {
    display: flex;
    gap: 0.5rem;
}

.bmr-input-with-select .bmr-form-control {
    flex: 1;
}

.bmr-unit-select {
    min-width: 80px;
    padding: 0.875rem 0.75rem;
    border: 2px solid var(--bmr-border);
    border-radius: var(--bmr-radius);
    font-size: 1rem;
    background: white;
    color: var(--bmr-dark);
    transition: var(--bmr-transition);
}

.bmr-unit-select:focus {
    outline: none;
    border-color: var(--bmr-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Height Feet Inputs */
.bmr-height-feet-inputs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.bmr-height-feet-inputs .bmr-form-control {
    flex: 1;
}

/* Help Text */
.bmr-help-text {
    color: var(--bmr-secondary);
    font-size: 0.85rem;
    margin: 0;
}

/* Buttons */
.bmr-button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.bmr-btn {
    padding: 0.875rem 1.5rem;
    border-radius: var(--bmr-radius);
    font-size: 1rem;
    font-weight: 600;
    text-transform: none;
    cursor: pointer;
    transition: var(--bmr-transition);
    border: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-height: 48px;
}

/* Add spacing for icons in BMR buttons */
.bmr-btn i,
.bmr-btn .fas,
.bmr-btn .far,
.bmr-btn .fab {
    margin-right: 0.5rem;
}

/* Handle icons at the end of buttons */
.bmr-btn i:last-child,
.bmr-btn .fas:last-child,
.bmr-btn .far:last-child,
.bmr-btn .fab:last-child {
    margin-right: 0;
    margin-left: 0.5rem;
}

.bmr-btn:hover {
    transform: translateY(-2px);
}

.bmr-btn:active {
    transform: translateY(0);
}

.bmr-btn-primary {
    background: linear-gradient(135deg, var(--bmr-primary), var(--bmr-primary-dark));
    color: white;
    border-color: var(--bmr-primary);
    flex: 1;
}

.bmr-btn-primary:hover {
    background: linear-gradient(135deg, var(--bmr-primary-dark), #1d4ed8);
    box-shadow: var(--bmr-shadow-lg);
}

.bmr-btn-secondary {
    background: var(--bmr-light);
    color: var(--bmr-secondary);
    border-color: var(--bmr-border);
}

.bmr-btn-secondary:hover {
    background: var(--bmr-border);
    color: var(--bmr-dark);
}

.bmr-btn-outline {
    background: transparent;
    color: var(--bmr-primary);
    border-color: var(--bmr-primary);
}

.bmr-btn-outline:hover {
    background: var(--bmr-primary);
    color: white;
}

.bmr-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Results Section */
.bmr-results-section {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bmr-result-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--bmr-light), #ffffff);
    border-radius: var(--bmr-radius);
    border: 1px solid var(--bmr-border);
}

.bmr-result-item h3 {
    color: var(--bmr-dark);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.bmr-result-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--bmr-primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, var(--bmr-primary), var(--bmr-info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bmr-result-description {
    color: var(--bmr-secondary);
    margin: 0;
    font-size: 0.95rem;
}

/* Calorie Goals */
.bmr-calorie-goals {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--bmr-radius);
    border: 1px solid var(--bmr-border);
}

.bmr-calorie-goals h3 {
    color: var(--bmr-dark);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.bmr-goal-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bmr-goal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-radius: var(--bmr-radius);
    transition: var(--bmr-transition);
    border: 1px solid var(--bmr-border);
}

.bmr-goal-item:hover {
    transform: translateX(4px);
    box-shadow: var(--bmr-shadow);
}

.bmr-goal-loss {
    background: linear-gradient(135deg, #fef2f2, #ffffff);
    border-color: #fecaca;
}

.bmr-goal-maintain {
    background: linear-gradient(135deg, #f0f9ff, #ffffff);
    border-color: #bae6fd;
}

.bmr-goal-gain {
    background: linear-gradient(135deg, #f0fdf4, #ffffff);
    border-color: #bbf7d0;
}

.bmr-goal-label {
    font-weight: 600;
    color: var(--bmr-dark);
    font-size: 0.95rem;
}

.bmr-goal-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--bmr-primary);
}

/* Empty State */
.bmr-no-results {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.bmr-empty-state {
    max-width: 300px;
}

.bmr-empty-state i {
    color: var(--bmr-secondary);
    margin-bottom: 1rem;
    opacity: 0.6;
}

.bmr-empty-state h4 {
    color: var(--bmr-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.bmr-empty-state p {
    color: var(--bmr-secondary);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Info Section */
.bmr-info-section {
    margin-top: 3rem;
}

.bmr-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.bmr-info-card {
    background: white;
    padding: 2rem;
    border-radius: var(--bmr-radius-lg);
    box-shadow: var(--bmr-shadow);
    border: 1px solid var(--bmr-border);
    transition: var(--bmr-transition);
}

.bmr-info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--bmr-shadow-lg);
}

.bmr-info-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--bmr-primary);
}

.bmr-info-header i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.bmr-info-header h3 {
    color: var(--bmr-dark);
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.bmr-info-card p {
    color: var(--bmr-secondary);
    line-height: 1.6;
    margin: 0;
}

.bmr-info-card ul {
    color: var(--bmr-secondary);
    line-height: 1.6;
    margin: 0;
    padding-left: 1.25rem;
}

.bmr-info-card li {
    margin-bottom: 0.5rem;
}

.bmr-info-card strong {
    color: var(--bmr-dark);
}

/* Tool Actions */
.bmr-tool-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 3rem 0;
    flex-wrap: wrap;
}

/* History Section */
.bmr-history-section {
    margin-top: 3rem;
    background: white;
    border-radius: var(--bmr-radius-lg);
    padding: 2rem;
    box-shadow: var(--bmr-shadow);
    border: 1px solid var(--bmr-border);
}

.bmr-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.bmr-history-header h3 {
    color: var(--bmr-dark);
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.bmr-history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .bmr-tool-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .bmr-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .bmr-hero-title {
        font-size: 2.5rem;
    }
    
    .bmr-hero-description {
        font-size: 1.1rem;
    }
    
    .bmr-tool-card {
        padding: 1.5rem;
    }
    
    .bmr-button-group {
        flex-direction: column;
    }
    
    .bmr-btn {
        justify-content: center;
    }
    
    .bmr-tool-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .bmr-tool-actions .bmr-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .bmr-history-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bmr-goal-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .bmr-input-with-select {
        flex-direction: column;
    }
    
    .bmr-unit-select {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .bmr-hero-section {
        padding: 2rem 0;
    }
    
    .bmr-hero-title {
        font-size: 2rem;
    }
    
    .bmr-tool-main {
        padding: 2rem 0;
    }
    
    .bmr-tool-card {
        padding: 1rem;
    }
    
    .bmr-info-card {
        padding: 1.5rem;
    }
    
    .bmr-result-value {
        font-size: 2rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bmr-light: #1e293b;
        --bmr-dark: #f8fafc;
        --bmr-border: #334155;
        --bmr-secondary: #94a3b8;
    }
    
    .bmr-tool-card,
    .bmr-info-card,
    .bmr-history-section {
        background: #1e293b;
        border-color: #334155;
    }
    
    .bmr-form-control,
    .bmr-unit-select {
        background: #334155;
        border-color: #475569;
        color: #f8fafc;
    }
    
    .bmr-form-control::placeholder {
        color: #94a3b8;
    }
}

/* Animation utilities */
.bmr-fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bmr-slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bmr-input-section {
    margin-bottom: 2rem;
}

.bmr-input-group {
    margin-bottom: 1.5rem;
}

.bmr-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.bmr-form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.bmr-form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.bmr-input-with-select {
    display: flex;
    gap: 0.5rem;
}

.bmr-input-with-select input {
    flex: 1;
}

.bmr-unit-select {
    width: 80px;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
}

.bmr-height-inputs {
    display: none;
}

.bmr-height-inputs.active {
    display: flex;
    gap: 1rem;
}

.bmr-height-inputs .bmr-input-group {
    flex: 1;
}

.bmr-input-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.85rem;
}

.bmr-advanced-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.bmr-advanced-toggle {
    background: none;
    border: none;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.bmr-advanced-toggle:hover {
    color: #5a67d8;
}

.bmr-advanced-options {
    display: none;
}

.bmr-advanced-options.active {
    display: block;
}

.bmr-calculate-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.bmr-calculate-btn:hover {
    transform: translateY(-2px);
}

.bmr-calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.bmr-results-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
}

.bmr-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.bmr-result-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s ease;
}

.bmr-result-card:hover {
    border-color: #667eea;
}

.bmr-result-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bmr-result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.25rem;
}

.bmr-result-unit {
    font-size: 0.85rem;
    color: #666;
}

.bmr-activity-breakdown {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
}

.bmr-activity-breakdown h4 {
    margin-bottom: 1rem;
    color: #333;
}

.bmr-activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.bmr-activity-item:last-child {
    border-bottom: none;
}

.bmr-activity-label {
    font-weight: 500;
    color: #555;
}

.bmr-activity-calories {
    font-weight: 600;
    color: #667eea;
}

.bmr-history-section {
    margin-top: 2rem;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e0e0e0;
}

.bmr-history-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.bmr-clear-history {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.bmr-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bmr-history-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    border-left: 3px solid #667eea;
}

.bmr-history-date {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.bmr-history-details {
    font-size: 0.9rem;
    color: #333;
}

.bmr-history-empty {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

.bmr-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
}

.bmr-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.bmr-info-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.bmr-info-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.bmr-info-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.bmr-info-description {
    color: #666;
    line-height: 1.5;
}

/* Responsive design */
@media (max-width: 768px) {
    .bmr-hero-title {
        font-size: 2rem;
    }
    
    .bmr-tool-grid {
        grid-template-columns: 1fr;
    }
    
    .bmr-input-with-select {
        flex-direction: column;
    }
    
    .bmr-unit-select {
        width: 100%;
    }
    
    .bmr-height-inputs {
        flex-direction: column;
        gap: 1rem;
    }
    
    .bmr-results-grid {
        grid-template-columns: 1fr;
    }
    
    .bmr-info-cards {
        grid-template-columns: 1fr;
    }
}
