/**
 * Tools CSS - Styles for Interactive Food Assistance Tools
 * Shared styles across all tool pages
 */

/* ========================================
   Calculator Card Styles
   ======================================== */

.calculator-card {
    border-radius: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0 20px;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e9ecef;
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    transition: color 0.3s ease;
}

.step.active .step-number {
    background: #2d5016;
    color: white;
    transform: scale(1.1);
}

.step.active .step-label {
    color: #2d5016;
    font-weight: 600;
}

.step.completed .step-number {
    background: #28a745;
    color: white;
}

.step.completed .step-number::after {
    content: '\f26b';
    font-family: 'bootstrap-icons';
}

/* Calculator Steps */
.calculator-step {
    animation: fadeIn 0.4s ease;
}

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

/* ========================================
   Quiz Styles
   ======================================== */

.quiz-card {
    border-radius: 15px;
    min-height: 500px;
}

.quiz-question {
    animation: slideIn 0.3s ease;
}

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

.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.quiz-option {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.quiz-option:hover {
    border-color: #2d5016;
    background: #f8f9fa;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.quiz-option.selected {
    border-color: #2d5016;
    background: #e8f5e9;
    transform: scale(1.05);
}

.quiz-option i {
    color: #2d5016;
    transition: transform 0.3s ease;
}

.quiz-option:hover i {
    transform: scale(1.1);
}

.quiz-option h5 {
    color: #2d5016;
    margin-bottom: 10px;
    font-weight: 600;
}

.quiz-option p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

/* ========================================
   Tool Card Styles (Hub Page)
   ======================================== */

.tool-card {
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.tool-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
    border-color: #2d5016;
}

.tool-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.tool-features .badge {
    font-size: 0.75rem;
    padding: 6px 10px;
    font-weight: 500;
}

/* Featured Tool Ribbon */
.featured-tool {
    position: relative;
    overflow: hidden;
}

.ribbon {
    position: absolute;
    top: 15px;
    right: -35px;
    width: 150px;
    text-align: center;
    background: #ffc107;
    color: #212529;
    font-weight: bold;
    padding: 5px 0;
    transform: rotate(45deg);
    z-index: 10;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* ========================================
   Comparison Table
   ======================================== */

.comparison-table {
    font-size: 0.95rem;
}

.comparison-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #28a745;
    color: white;
    font-weight: 600;
    padding: 15px;
}

.comparison-table tbody th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2d5016;
}

.comparison-table td {
    padding: 12px;
    vertical-align: middle;
}

.comparison-table .best-value {
    background: #d4edda;
    font-weight: 600;
}

.comparison-table .remove-btn {
    cursor: pointer;
    color: #dc3545;
}

/* ========================================
   Selection & Search
   ======================================== */

.selected-items .empty-slot {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.selected-items .selected-card {
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 15px;
    background: white;
    position: relative;
}

.selected-items .remove-selection {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    color: #dc3545;
    font-size: 1.2rem;
}

/* ========================================
   Results & Recommendations
   ======================================== */

.result-card {
    border-left: 4px solid #2d5016;
    transition: all 0.3s ease;
}

.result-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

.result-badge {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    margin: 5px;
}

.result-badge.eligible {
    background: #d4edda;
    color: #155724;
}

.result-badge.not-eligible {
    background: #f8d7da;
    color: #721c24;
}

.result-badge.maybe {
    background: #fff3cd;
    color: #856404;
}

/* Recommendation Card */
.recommendation-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.recommendation-card h4 {
    font-weight: 700;
}

/* ========================================
   Loading States
   ======================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner .spinner-border {
    width: 4rem;
    height: 4rem;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .no-print,
    nav,
    .navbar,
    .left-nav,
    .breadcrumb,
    .btn,
    button,
    .progress-steps,
    .quiz-options,
    .tool-features {
        display: none !important;
    }

    .calculator-card,
    .tool-card,
    .result-card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }

    .col-lg-8,
    .col-md-8 {
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    body {
        background: white !important;
    }
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
    .progress-steps {
        padding: 0 10px;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .step-number {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .quiz-options {
        grid-template-columns: 1fr;
    }

    .quiz-option {
        padding: 20px 15px;
    }

    .tool-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .comparison-table {
        font-size: 0.8rem;
    }

    .comparison-table td,
    .comparison-table th {
        padding: 8px 5px;
    }
}

/* ========================================
   Accessibility Enhancements
   ======================================== */

.quiz-option:focus,
.step:focus,
.tool-card:focus {
    outline: 3px solid #2d5016;
    outline-offset: 3px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .quiz-option {
        border-width: 3px;
    }

    .step-number {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.bg-gradient-green {
    background: linear-gradient(135deg, #2d5016 0%, #4a7c2f 100%);
}

.text-dark-green {
    color: #2d5016 !important;
}

.bg-light-green {
    background-color: #e8f5e9 !important;
}

.border-success {
    border-color: #2d5016 !important;
}

.shadow-lg-hover:hover {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* ========================================
   Animation Classes
   ======================================== */

.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

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

.pulse {
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}
