/**
 * Food Inspection Manager - Public Styles
 * 
 * Styles for frontend shortcodes
 */

.fim-establishment-score {
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    margin: 20px 0;
}

.fim-establishment-score h3 {
    margin-top: 0;
    color: #0073aa;
}

.fim-establishment-score p {
    margin: 10px 0;
}

/* ========================================
   GLOBAL STYLES
   ======================================== */
.fim-frontend-manager,
.fim-frontend-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    line-height: 1.6;
}

.fim-frontend-manager {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ========================================
   MANAGER HEADER
   ======================================== */
.fim-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.fim-manager-header h2 {
    margin: 0;
    padding: 0;
    font-size: 28px;
    color: #333;
}

.fim-manager-header p {
    width: 100%;
    margin: 10px 0 0 0;
    color: #666;
    font-size: 14px;
}

/* ========================================
   BUTTONS
   ======================================== */
.fim-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
}

.fim-btn:hover {
    transform: translateY(-1px);
}

.fim-btn-primary {
    background: #2271b1;
    color: #fff;
}

.fim-btn-primary:hover {
    background: #135e96;
}

.fim-btn-secondary {
    background: #fff;
    color: #2271b1;
    border: 2px solid #2271b1;
}

.fim-btn-secondary:hover {
    background: #2271b1;
    color: #fff !important;
    text-decoration: none;
}

.fim-btn-danger {
    background: #d9534f;
    color: #fff;
}

.fim-btn-danger:hover {
    background: #c9302c;
    color: #fff !important;
}

.fim-btn-info {
    background: #1258C2;
    color: #fff !important;
    border: none;
}

.fim-btn-info:hover {
    background: #0d47a1;
    color: #fff !important;
    text-decoration: none;
}

.fim-btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

.fim-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ========================================
   SEARCH BAR
   ======================================== */
.fim-search-bar {
    margin-bottom: 20px;
}

.fim-search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

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

/* ========================================
   TABLE STYLES
   ======================================== */
.fim-table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.fim-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.fim-table thead {
    background: #f8f9fa;
}

.fim-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    font-size: 14px;
}

.fim-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.fim-table tbody tr:hover {
    background: #f8f9fa;
}

.fim-table tbody tr:last-child td {
    border-bottom: none;
}

.fim-loading {
    text-align: center;
    color: #666;
    padding: 30px !important;
    font-style: italic;
}

/* ========================================
   BADGES
   ======================================== */
.fim-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.fim-badge-success {
    background: #d4edda;
    color: #155724;
}

.fim-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.fim-badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.fim-badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

/* ========================================
   MODAL STYLES
   ======================================== */
.fim-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fim-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.fim-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.fim-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.fim-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
}

.fim-modal-close:hover {
    color: #333;
}

.fim-modal form {
    padding: 25px;
}

.fim-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    margin-top: 20px;
}

/* ========================================
   FORM STYLES
   ======================================== */
.fim-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.fim-form-group {
    margin-bottom: 20px;
}

.fim-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.fim-form-group .required {
    color: #d9534f;
}

.fim-input,
.fim-select,
.fim-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.fim-input:focus,
.fim-select:focus,
.fim-textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.fim-textarea {
    resize: vertical;
    min-height: 80px;
}

.fim-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
}

.fim-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (min-width: 768px) {
    .fim-form-row {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .fim-manager-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fim-btn {
        width: 100%;
    }
    
    .fim-modal-content {
        margin: 0;
    }
    
    .fim-search-input {
        max-width: 100%;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.required {
    color: #d9534f;
    font-weight: bold;
}

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

.text-muted {
    color: #666;
}

/* ========================================
   CLICKABLE STAT CARDS
   ======================================== */
a.fim-stat-card.fim-stat-link {
    display: flex;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
a.fim-stat-card.fim-stat-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    text-decoration: none;
    color: inherit;
}
a.fim-stat-card.fim-stat-link .fim-stat-value {
    color: #1258C2;
}
a.fim-stat-card.fim-stat-warning.fim-stat-link .fim-stat-value { color: #d97706; }
a.fim-stat-card.fim-stat-danger.fim-stat-link  .fim-stat-value { color: #dc2626; }

/* Quick action anchors styled like buttons */
.fim-action-buttons a.fim-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.fim-action-buttons a.fim-btn:hover { text-decoration: none; }

/* ========================================
   ESTABLISHMENT PHOTO GALLERY (public results)
   ======================================== */
.fim-photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.fim-photo-thumb {
    display: block;
    width: 120px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    transition: border-color .15s, transform .15s;
    flex-shrink: 0;
}
.fim-photo-thumb:hover {
    border-color: #1258C2;
    transform: scale(1.04);
}
.fim-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@media (max-width: 480px) {
    .fim-photo-thumb { width: 80px; height: 60px; }
}
