/* 
 * Ryedale Foodbank Referral Viewer Styles
 * Optimized for elderly and non-tech-literate users
 * - Large, readable text
 * - High contrast colors
 * - Simple, clear layout
 * - Prominent buttons
 */

/* ===== HIDE SIDEBAR ON REFERRAL PAGES ===== */
body.page .widget-area,
body.page aside,
body.page .sidebar,
#secondary,
.sidebar,
.widget-area {
    display: none !important;
}

body.page .site-content,
body.page .content-area,
body.page #primary,
.site-content,
.content-area,
#primary {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    float: none !important;
}

/* Force full width on common WordPress themes */
.site-main,
.main-content,
article,
.entry-content {
    width: 100% !important;
    max-width: 100% !important;
}

/* ===== GENERAL CONTAINER ===== */
.foodbank-viewer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #222;
}

/* ===== HEADER SECTION ===== */
.foodbank-viewer-header {
    background: #f8f9fa;
    border: 3px solid #0066cc;
    border-radius: 8px;
    padding: 20px 25px;
    margin-bottom: 25px;
    text-align: center;
}

.foodbank-viewer-header h1 {
    margin: 0 0 10px 0;
    font-size: 32px;
    color: #0066cc;
    font-weight: bold;
}

.foodbank-viewer-welcome {
    font-size: 18px;
    margin: 5px 0;
    color: #333;
}

.foodbank-viewer-logout {
    margin-top: 10px;
}

/* ===== BUTTONS ===== */
.foodbank-btn {
    display: inline-block;
    background-color: #0066cc;
    color: white;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-align: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.foodbank-btn:hover {
    background-color: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

.foodbank-btn:active {
    transform: translateY(0);
}

.foodbank-btn-secondary {
    display: inline-block;
    background-color: #6c757d;
    color: white;
    padding: 12px 25px;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    margin: 5px;
}

.foodbank-btn-secondary:hover {
    background-color: #5a6268;
}

.foodbank-btn-back {
    display: inline-block;
    background-color: #28a745;
    color: white;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.foodbank-btn-back:hover {
    background-color: #218838;
}

/* ===== PRINT BUTTONS ===== */
.foodbank-btn-print,
.foodbank-btn-print-large {
    display: inline-block;
    background-color: #ff6600;
    color: white;
    padding: 20px 40px;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 10px;
    border: 3px solid #cc5200;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin: 10px;
}

.foodbank-btn-print:hover,
.foodbank-btn-print-large:hover {
    background-color: #cc5200;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.foodbank-btn-print-large {
    font-size: 28px;
    padding: 25px 50px;
    margin: 20px 0;
}

/* ===== INFO MESSAGES ===== */
.foodbank-viewer-info {
    background: #e7f3ff;
    border-left: 5px solid #0066cc;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 5px;
    font-size: 20px;
}

.foodbank-viewer-info p {
    margin: 8px 0;
}

.foodbank-viewer-help {
    font-size: 18px;
    color: #555;
    font-style: italic;
}

.foodbank-viewer-empty {
    background: #fff3cd;
    border: 3px solid #ffc107;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin: 30px 0;
}

.foodbank-viewer-empty h2 {
    font-size: 32px;
    color: #856404;
    margin-bottom: 15px;
}

.foodbank-viewer-empty p {
    font-size: 22px;
    color: #856404;
}

.foodbank-viewer-error {
    background: #f8d7da;
    border: 3px solid #dc3545;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin: 30px 0;
}

.foodbank-viewer-error h2 {
    font-size: 32px;
    color: #721c24;
    margin-bottom: 15px;
}

.foodbank-viewer-error p {
    font-size: 22px;
    color: #721c24;
    margin: 10px 0;
}

/* ===== FILTERS ===== */
.foodbank-filters {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.foodbank-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.foodbank-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.foodbank-filter-group label {
    font-weight: bold;
    font-size: 18px;
    color: #333;
}

.foodbank-filter-group select {
    padding: 12px 15px;
    font-size: 18px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    min-width: 200px;
}

.foodbank-filter-group select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* ===== SECTIONS ===== */
.foodbank-section {
    margin-bottom: 40px;
}

.foodbank-section-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 15px 20px;
    border-radius: 8px;
}

.foodbank-section-pending .foodbank-section-title {
    background: #fff3cd;
    color: #856404;
    border: 3px solid #ffc107;
}

.foodbank-section-completed .foodbank-section-title {
    background: #d4edda;
    color: #155724;
    border: 3px solid #28a745;
}

/* ===== STATUS BADGES ===== */
.foodbank-referral-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.foodbank-referral-status {
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
}

.foodbank-status-pending {
    background: #ffc107;
    color: #856404;
}

.foodbank-status-completed {
    background: #28a745;
    color: white;
}

.foodbank-referral-card.status-pending {
    border-left: 6px solid #ffc107;
}

.foodbank-referral-card.status-completed {
    border-left: 6px solid #28a745;
    opacity: 0.9;
}

/* ===== REFERRAL LIST (CARDS) ===== */
.foodbank-referral-list {
    display: grid;
    gap: 25px;
    margin-top: 25px;
}

.foodbank-referral-card {
    background: white;
    border: 3px solid #ddd;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.foodbank-referral-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border-color: #0066cc;
}

.foodbank-referral-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #e9ecef;
}

.foodbank-referral-card-header h2 {
    margin: 0;
    font-size: 28px;
    color: #0066cc;
    font-weight: bold;
}

.foodbank-referral-date {
    background: #0066cc;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap;
}

.foodbank-referral-card-body {
    margin: 20px 0;
}

.foodbank-referral-info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 20px;
}

.foodbank-referral-info-row:last-child {
    border-bottom: none;
}

.foodbank-label {
    font-weight: bold;
    color: #555;
    min-width: 180px;
    flex-shrink: 0;
}

.foodbank-value {
    color: #222;
    flex-grow: 1;
}

.foodbank-referral-card-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 3px solid #e9ecef;
    text-align: center;
}

/* ===== REFERRAL DETAIL VIEW ===== */
.foodbank-referral-detail {
    background: white;
    border: 3px solid #0066cc;
    border-radius: 10px;
    padding: 30px;
    margin-top: 20px;
}

.foodbank-detail-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 4px solid #0066cc;
}

.foodbank-detail-header h1 {
    margin: 0 0 15px 0;
    font-size: 38px;
    color: #0066cc;
    font-weight: bold;
}

.foodbank-detail-date {
    font-size: 22px;
    color: #555;
    font-weight: bold;
}

.foodbank-detail-section {
    margin-bottom: 35px;
    padding: 25px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
}

.foodbank-detail-section h2 {
    margin: 0 0 20px 0;
    font-size: 30px;
    color: #0066cc;
    font-weight: bold;
    padding-bottom: 15px;
    border-bottom: 3px solid #0066cc;
}

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

.foodbank-detail-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
}

.foodbank-detail-item.full-width {
    grid-column: 1 / -1;
}

.foodbank-detail-item.highlight {
    background: #fff3cd;
    border-color: #ffc107;
    border-width: 3px;
}

.foodbank-detail-label {
    font-weight: bold;
    color: #555;
    font-size: 18px;
    margin-bottom: 8px;
}

.foodbank-detail-value {
    color: #222;
    font-size: 22px;
    font-weight: 500;
}

/* ===== HOUSEHOLD TABLE ===== */
.foodbank-household-table {
    overflow-x: auto;
}

.foodbank-household-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 20px;
}

.foodbank-household-table th,
.foodbank-household-table td {
    padding: 15px;
    text-align: center;
    border: 2px solid #dee2e6;
}

.foodbank-household-table th {
    background: #0066cc;
    color: white;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
    vertical-align: middle;
}

.foodbank-household-table td {
    font-size: 24px;
    font-weight: 500;
}

.foodbank-household-table .total-column {
    background: #fff3cd;
    font-weight: bold;
    font-size: 26px;
}

/* ===== ADMIN ONLY SECTION ===== */
.foodbank-admin-only {
    background: #fff9e6;
    border-color: #ff9800;
}

.foodbank-admin-only h2 {
    color: #ff9800;
    border-bottom-color: #ff9800;
}

/* ===== FORM ELEMENTS ===== */
.foodbank-edit-form {
    margin-top: 20px;
}

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

.foodbank-form-group label {
    display: block;
    font-weight: bold;
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
}

.foodbank-input,
.foodbank-textarea {
    width: 100%;
    padding: 12px 15px;
    font-size: 18px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    background: white;
    font-family: Arial, Helvetica, sans-serif;
}

.foodbank-input:focus,
.foodbank-textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.foodbank-textarea {
    resize: vertical;
    min-height: 100px;
}

.foodbank-form-actions {
    margin-top: 25px;
    text-align: center;
}

.foodbank-btn-primary {
    background-color: #28a745;
    font-size: 22px;
    padding: 18px 40px;
}

.foodbank-btn-primary:hover {
    background-color: #218838;
}

/* ===== SUCCESS MESSAGE ===== */
.foodbank-success-message {
    background: #d4edda;
    border: 3px solid #28a745;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: bold;
    color: #155724;
    text-align: center;
}

/* ===== FOOTER ===== */
.foodbank-detail-footer {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 4px solid #0066cc;
    text-align: center;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .foodbank-viewer-container {
        padding: 15px;
        font-size: 16px;
    }
    
    .foodbank-viewer-header h1 {
        font-size: 28px;
    }
    
    .foodbank-viewer-welcome {
        font-size: 18px;
    }
    
    .foodbank-btn {
        font-size: 18px;
        padding: 12px 24px;
    }
    
    .foodbank-btn-print,
    .foodbank-btn-print-large {
        font-size: 20px;
        padding: 15px 30px;
    }
    
    .foodbank-filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .foodbank-filter-group select {
        min-width: 100%;
    }
    
    .foodbank-section-title {
        font-size: 24px;
        padding: 12px 15px;
    }
    
    .foodbank-referral-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .foodbank-referral-card-header h2 {
        font-size: 24px;
    }
    
    .foodbank-referral-meta {
        align-items: flex-start;
    }
    
    .foodbank-referral-date {
        font-size: 16px;
    }
    
    .foodbank-referral-info-row {
        flex-direction: column;
        font-size: 18px;
    }
    
    .foodbank-label {
        min-width: auto;
        margin-bottom: 5px;
    }
    
    .foodbank-detail-header h1 {
        font-size: 30px;
    }
    
    .foodbank-detail-date {
        font-size: 18px;
    }
    
    .foodbank-detail-section h2 {
        font-size: 24px;
    }
    
    .foodbank-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .foodbank-household-table {
        font-size: 14px;
    }
    
    .foodbank-household-table th,
    .foodbank-household-table td {
        padding: 8px 4px;
        font-size: 14px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    /* Hide elements not needed for printing */
    .no-print,
    .foodbank-viewer-header,
    .foodbank-btn,
    .foodbank-btn-secondary,
    .foodbank-btn-back,
    .foodbank-btn-print,
    .foodbank-btn-print-large,
    .foodbank-detail-footer,
    header,
    footer,
    nav,
    aside,
    .sidebar,
    .widget-area,
    #secondary,
    .site-header,
    .site-footer,
    .site-navigation,
    #masthead,
    #colophon {
        display: none !important;
    }
    
    /* Optimize for printing */
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
    }
    
    .foodbank-viewer-container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .foodbank-referral-detail {
        border: 2px solid #000;
        padding: 20px;
        margin: 0;
    }
    
    .foodbank-detail-header {
        page-break-after: avoid;
    }
    
    .foodbank-detail-header h1 {
        font-size: 24pt;
        color: #000;
    }
    
    .foodbank-detail-date {
        font-size: 14pt;
        color: #000;
    }
    
    .foodbank-detail-section {
        page-break-inside: avoid;
        background: white;
        border: 1px solid #000;
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .foodbank-detail-section h2 {
        font-size: 16pt;
        color: #000;
        border-bottom: 2px solid #000;
        padding-bottom: 8px;
        margin-bottom: 12px;
    }
    
    .foodbank-detail-item {
        background: white;
        border: 1px solid #ccc;
        padding: 10px;
        margin-bottom: 8px;
    }
    
    .foodbank-detail-item.highlight {
        background: #f0f0f0;
        border: 2px solid #000;
    }
    
    .foodbank-detail-label {
        font-size: 11pt;
        color: #000;
    }
    
    .foodbank-detail-value {
        font-size: 12pt;
        color: #000;
    }
    
    .foodbank-household-table table {
        border: 2px solid #000;
    }
    
    .foodbank-household-table th {
        background: #e0e0e0 !important;
        color: #000 !important;
        border: 1px solid #000;
        font-size: 11pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .foodbank-household-table td {
        border: 1px solid #000;
        font-size: 12pt;
    }
    
    .foodbank-household-table .total-column {
        background: #f0f0f0 !important;
        border: 2px solid #000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Ensure admin-only section prints if present */
    .foodbank-admin-only {
        background: #f9f9f9 !important;
        border: 2px solid #000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .foodbank-admin-only h2 {
        color: #000;
        border-bottom-color: #000;
    }
    
    /* Add page breaks where appropriate */
    .foodbank-detail-section {
        page-break-inside: avoid;
    }
    
    /* Ensure links are visible */
    a[href]:after {
        content: none;
    }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
/* Focus states for keyboard navigation */
.foodbank-btn:focus,
.foodbank-btn-secondary:focus,
.foodbank-btn-back:focus,
.foodbank-btn-print:focus,
.foodbank-btn-print-large:focus {
    outline: 4px solid #ff6600;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .foodbank-viewer-container {
        color: #000;
    }
    
    .foodbank-btn {
        border: 3px solid #000;
    }
    
    .foodbank-detail-section {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
