/* Farm Records Health Check Styles */
/* Enhanced styling for health check system integration */

/* ============ HEALTH CHECK WIDGET ============ */
.health-check-widget {
    background: linear-gradient(135deg, var(--logo-beige, #f5f2e8) 0%, #ffffff 100%);
    border: 2px solid var(--logo-green, #2E7D2E);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(46, 125, 46, 0.15);
    transition: all 0.3s ease;
}

.health-check-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 46, 0.2);
}

.health-check-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.health-check-header h3 {
    color: var(--logo-green, #2E7D2E);
    margin: 0;
    font-weight: 600;
}

.btn-health-check {
    background: var(--logo-green, #2E7D2E);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-health-check:hover {
    background: var(--logo-brown, #8B4513);
    transform: translateY(-1px);
}

/* ============ HEALTH CHECK SUMMARY ============ */
.health-check-summary {
    margin: 15px 0;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.health-check-summary.healthy {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    color: #155724;
}

.health-check-summary.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
    color: #856404;
}

.health-check-summary.critical {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.health-check-summary.info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.status-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.status-icon {
    font-size: 20px;
}

.status-details {
    font-size: 12px;
    opacity: 0.8;
}

.health-check-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

/* ============ HEALTH CHECK PAGE ============ */
.health-check-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.export-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: var(--logo-brown, #8B4513);
    color: var(--logo-yellow, #FFD700);
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-toggle:hover {
    background: #654321;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 150px;
}

.export-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s ease;
}

.dropdown-menu a:hover {
    background: var(--logo-beige, #f5f2e8);
}

/* ============ OVERVIEW CARDS ============ */
.health-check-overview {
    margin: 20px 0;
}

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

.overview-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.overview-card.critical {
    border-left: 4px solid #dc3545;
}

.overview-card.high {
    border-left: 4px solid #fd7e14;
}

.overview-card.medium {
    border-left: 4px solid #ffc107;
}

.overview-card.low {
    border-left: 4px solid #28a745;
}

.card-icon {
    font-size: 2em;
    opacity: 0.8;
}

.card-content h3 {
    font-size: 2em;
    margin: 0;
    font-weight: 700;
}

.card-content p {
    margin: 5px 0 0 0;
    color: #666;
    font-weight: 500;
}

/* ============ HEALTH CHECK DETAILS ============ */
.health-check-details {
    margin: 30px 0;
}

.details-placeholder {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--logo-beige, #f5f2e8) 0%, #ffffff 100%);
    border-radius: 12px;
    border: 2px dashed var(--logo-green, #2E7D2E);
}

.placeholder-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.6;
}

.details-placeholder h3 {
    color: var(--logo-green, #2E7D2E);
    margin-bottom: 10px;
}

.details-placeholder p {
    color: #666;
    max-width: 400px;
    margin: 0 auto;
}

.category-section {
    background: white;
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-section h3 {
    background: var(--logo-green, #2E7D2E);
    color: white;
    padding: 15px 20px;
    margin: 0;
    font-weight: 600;
}

.issues-list {
    padding: 0;
}

.issue-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
    transition: background 0.3s ease;
}

.issue-item:last-child {
    border-bottom: none;
}

.issue-item:hover {
    background: #f8f9fa;
}

.issue-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.severity-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-badge.critical {
    background: #dc3545;
    color: white;
}

.severity-badge.high {
    background: #fd7e14;
    color: white;
}

.severity-badge.medium {
    background: #ffc107;
    color: #333;
}

.severity-badge.low {
    background: #28a745;
    color: white;
}

.issue-title {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.issue-count {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
}

.issue-details {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
}

.detail-item {
    margin: 5px 0;
    color: #555;
}

.detail-more {
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

.issue-recommendations {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #e7f3ff 0%, #cce7ff 100%);
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.issue-recommendations strong {
    color: #0056b3;
}

.issue-recommendations ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.issue-recommendations li {
    margin: 5px 0;
    color: #333;
}

/* ============ NO ISSUES STATE ============ */
.no-issues {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 12px;
    border: 2px solid #c3e6cb;
}

.success-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.no-issues h3 {
    color: #155724;
    margin-bottom: 10px;
}

.no-issues p {
    color: #155724;
    opacity: 0.8;
}

/* ============ HEALTH CHECK HISTORY ============ */
.health-check-history {
    margin: 30px 0;
}

.health-check-history h3 {
    color: var(--logo-green, #2E7D2E);
    margin-bottom: 15px;
}

.history-timeline {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.history-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item.critical::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #dc3545;
}

.history-item.warning::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #ffc107;
}

.history-item.success::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #28a745;
}

.history-date {
    font-weight: 600;
    color: #333;
}

.history-summary {
    font-size: 14px;
    color: #666;
}

.no-history {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* ============ SETTINGS ============ */
.health-check-settings {
    margin: 30px 0;
}

.health-check-settings h3 {
    color: var(--logo-green, #2E7D2E);
    margin-bottom: 15px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.setting-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* ============ NAVIGATION INTEGRATION ============ */
.nav-icon {
    margin-right: 5px;
}

.issue-badge {
    background: #dc3545;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    margin-left: 5px;
    font-weight: bold;
}

.issue-badge.critical {
    background: #dc3545;
    animation: pulse 2s infinite;
}

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

/* ============ STATUS INDICATOR ============ */
.health-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding: 5px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
}

.status-dot.critical {
    background: #dc3545;
    animation: pulse 2s infinite;
}

.status-dot.warning {
    background: #ffc107;
}

.status-dot.healthy {
    background: #28a745;
}

.status-text {
    font-size: 12px;
    color: white;
    font-weight: 500;
}

/* ============ FLOATING ACTION BUTTON ============ */
.health-check-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.health-check-fab button {
    background: var(--logo-green, #2E7D2E);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(46, 125, 46, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.health-check-fab button:hover {
    background: var(--logo-brown, #8B4513);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 46, 0.4);
}

.fab-icon {
    font-size: 16px;
}

.fab-text {
    font-size: 14px;
}

/* ============ NOTIFICATIONS ============ */
.notification-center {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 350px;
    max-height: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.notification-header {
    padding: 15px 20px;
    background: var(--logo-green, #2E7D2E);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h3 {
    margin: 0;
    font-size: 16px;
}

.btn-clear {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.notifications-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.notification:last-child {
    border-bottom: none;
}

.notification.critical {
    border-left: 4px solid #dc3545;
    background: #fdf2f2;
}

.notification.high {
    border-left: 4px solid #fd7e14;
    background: #fef9f3;
}

.notification.medium {
    border-left: 4px solid #ffc107;
    background: #fffef7;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

.notification-message {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.notification-time {
    font-size: 11px;
    color: #999;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.no-notifications {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* ============ TOAST NOTIFICATIONS ============ */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background: #28a745;
}

.toast-error {
    background: #dc3545;
}

.toast-warning {
    background: #ffc107;
    color: #333;
}

.toast-info {
    background: #17a2b8;
}

/* ============ LOADING STATES ============ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #666;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e3e3e3;
    border-top: 2px solid var(--logo-green, #2E7D2E);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============ RESPONSIVE DESIGN ============ */
@media (max-width: 768px) {
    .health-check-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .health-check-fab {
        bottom: 20px;
        right: 20px;
    }
    
    .health-check-fab .fab-text {
        display: none;
    }
    
    .notification-center {
        width: 90%;
        right: 5%;
    }
    
    .issue-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .history-item {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .health-check-widget {
        padding: 15px;
    }
    
    .health-check-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .health-check-actions {
        flex-direction: column;
    }
    
    .card-content h3 {
        font-size: 1.5em;
    }
    
    .overview-card {
        padding: 15px;
    }
}

/* ============ PRINT STYLES ============ */
@media print {
    .health-check-fab,
    .notification-center,
    .health-check-controls,
    .btn-health-check,
    .health-check-actions {
        display: none !important;
    }
    
    .health-check-widget,
    .category-section,
    .overview-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .health-check-page {
        display: block !important;
    }
}
