/* Public Styles for Food Inspection Manager */

/* Search */
.fim-public-search {
    margin: 20px 0;
}

.fim-search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.fim-search-input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.fim-search-input:focus {
    outline: none;
    border-color: #2271b1;
}

.fim-search-button {
    padding: 12px 30px;
    background-color: #2271b1;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.fim-search-button:hover {
    background-color: #135e96;
}

/* Establishments Grid */
.fim-establishments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.fim-establishment-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s, transform 0.3s;
}

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

.fim-establishment-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #23282d;
    font-size: 20px;
}

.fim-address {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.fim-phone {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

/* Score Display */
.fim-score-display {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.fim-grade-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 24px;
    color: white;
    margin-bottom: 10px;
}

.fim-inspection-date {
    font-size: 13px;
    color: #666;
    margin: 5px 0;
}

.fim-violations {
    font-size: 13px;
    margin: 10px 0;
}

.fim-critical-violations {
    color: #dc3545;
    font-weight: 600;
    display: block;
    margin: 3px 0;
}

.fim-noncritical-violations {
    color: #856404;
    display: block;
    margin: 3px 0;
}

.fim-view-details {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background-color: #2271b1;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.fim-view-details:hover {
    background-color: #135e96;
    color: white;
}

.fim-no-inspection {
    color: #999;
    font-style: italic;
    font-size: 14px;
}

/* Single Establishment View */
.fim-single-establishment {
    max-width: 1000px;
    margin: 20px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.fim-establishment-header {
    border-bottom: 2px solid #2271b1;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.fim-establishment-header h2 {
    margin-top: 0;
    color: #23282d;
}

.fim-latest-inspection {
    margin-bottom: 40px;
}

.fim-latest-inspection h3 {
    color: #23282d;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.fim-inspection-details {
    display: flex;
    gap: 30px;
    margin: 20px 0;
    align-items: center;
}

.fim-score-big {
    flex-shrink: 0;
}

.fim-score-big .fim-grade-badge {
    font-size: 48px;
    padding: 20px 40px;
}

.fim-inspection-info p {
    margin: 8px 0;
    font-size: 15px;
}

/* Violations Table */
.fim-violations-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.fim-violations-table th,
.fim-violations-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.fim-violations-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #23282d;
}

.fim-violations-table tr:hover {
    background-color: #f9f9f9;
}

.fim-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

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

.fim-badge-noncritical {
    background-color: #ffc107;
    color: #000;
}

/* History Table */
.fim-inspection-history {
    margin-top: 40px;
}

.fim-inspection-history h3 {
    color: #23282d;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.fim-history-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.fim-history-table th,
.fim-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.fim-history-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.fim-history-table tr:hover {
    background-color: #f9f9f9;
}

.fim-back-link {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.fim-back-link a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
}

.fim-back-link a:hover {
    text-decoration: underline;
}

/* Map */
#fim-map {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Results Loading */
.fim-loading-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .fim-establishments-grid {
        grid-template-columns: 1fr;
    }
    
    .fim-search-form {
        flex-direction: column;
    }
    
    .fim-search-button {
        width: 100%;
    }
    
    .fim-inspection-details {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fim-score-big .fim-grade-badge {
        font-size: 36px;
        padding: 15px 30px;
    }
    
    .fim-single-establishment {
        padding: 15px;
    }
    
    .fim-violations-table,
    .fim-history-table {
        font-size: 14px;
    }
    
    .fim-violations-table th,
    .fim-violations-table td,
    .fim-history-table th,
    .fim-history-table td {
        padding: 8px;
    }
}

/* Print Styles */
@media print {
    .fim-view-details,
    .fim-back-link,
    .fim-search-form {
        display: none;
    }
    
    .fim-single-establishment {
        box-shadow: none;
        padding: 0;
    }
}

/* Accessibility */
.fim-search-input:focus,
.fim-search-button:focus,
.fim-view-details:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Grade Colors */
.fim-grade-a { background-color: #28a745; }
.fim-grade-b { background-color: #5cb85c; }
.fim-grade-c { background-color: #ffc107; }
.fim-grade-d { background-color: #fd7e14; }
.fim-grade-f { background-color: #dc3545; }
