/* Ethical Butcher - Visitor Management System 
   Unified Stylesheet
   Developed by Peter Banfalvi (c) 2026 
*/

:root {
    --pistachio-dark: #b1c499;
    --eb-dark: #2C3E50;
    --white: #ffffff;
    --gray-bg: #f4f4f4;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --danger: #E74C3C;
    --text: #333333;
    --toggle-gray: #94a3b8;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }

body { 
    background: var(--gray-bg); 
    color: var(--eb-dark); 
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-footer { 
    text-align: center; 
    padding: 20px 0; 
    margin-top: auto; 
    background-color: var(--gray-bg);
    border-top: 1px solid #e0e0e0;
}
.site-footer p { font-size: 0.8rem; color: var(--eb-dark); margin: 0; }

/* =========================================
   PART A: VISITOR KIOSK (index.php)
   ========================================= */

.form-container {
    width: 100%; max-width: 800px; margin: 40px auto; background: var(--white);
    padding: 40px; border-radius: 10px; box-shadow: var(--shadow);
    border-top: 6px solid var(--pistachio-dark);
}

.form-container header { text-align: center; margin-bottom: 30px; border-bottom: 2px solid #eee; padding-bottom: 20px; }
.form-logo { height: 80px; width: auto; margin-bottom: 15px; }
.form-container h1 { font-size: 1.8rem; color: var(--eb-dark); margin-bottom: 5px; }
.subtitle { color: #7f8c8d; font-size: 1rem; }

.section { margin-bottom: 30px; background: #fafafa; padding: 20px; border-radius: 8px; border: 1px solid #eee; }
.section h3 { color: var(--eb-dark); margin-bottom: 15px; font-size: 1.2rem; border-bottom: 1px solid #e0e0e0; padding-bottom: 8px; }

.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { margin-bottom: 15px; }
.field label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: #555; }
.field input, .field select, .field textarea {
    width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 6px;
    font-size: 1rem; outline: none; background: var(--white); transition: border 0.2s;
}
.field input:focus { border-color: var(--pistachio-dark); }

/* Switches */
.q-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid #f1f5f9; }
.q-row span { font-size: 1rem; font-weight: 500; flex: 1; padding-right: 20px; color: var(--text); }
.toggle-group { display: flex; gap: 10px; }
.toggle-group input[type="radio"] { display: none; }
.toggle-btn { 
    padding: 10px 25px; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 0.85rem; 
    transition: all 0.2s ease; color: var(--toggle-gray); text-align: center; min-width: 80px;
    background: #f1f5f9; border: 1px solid #e2e8f0; display: inline-block;
}
input[type="radio"]:checked + .toggle-btn.yes { background-color: #fee2e2; color: #dc2626; border-color: #fecaca; }
input[type="radio"]:checked + .toggle-btn.no { background-color: #dcfce7; color: #16a34a; border-color: #bbf7d0; }

/* Signature & Buttons */
.signature-area { border: 2px dashed #ccc; background: #fff; border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
canvas { width: 100%; height: 200px; display: block; touch-action: none; cursor: crosshair; }
.clear-sig-btn { background: none; border: none; color: var(--danger); font-size: 0.85rem; cursor: pointer; text-decoration: underline; float: right; }

.action-btn-secondary {
    background: #fff; border: 2px solid var(--eb-dark); color: var(--eb-dark);
    padding: 10px 20px; border-radius: 6px; font-weight: 600; cursor: pointer;
    transition: 0.2s; font-size: 0.95rem; width: 100%;
}
.action-btn-secondary:hover { background: #f0f0f0; }

.submit-btn {
    background: var(--pistachio-dark); color: white; border: none; padding: 15px;
    border-radius: 8px; font-size: 1.1rem; font-weight: 700; cursor: pointer;
    margin-top: 20px; transition: background 0.3s; width: 100%;
}
.submit-btn:hover { background: #9ab080; }
.submit-btn:disabled { background: #ccc; cursor: not-allowed; }

/* Modal specific */
.regs-content {
    height: 400px; overflow-y: auto; background: #f9f9f9; padding: 20px; 
    border: 1px solid #ddd; margin: 20px 0; font-size: 0.95rem; line-height: 1.6;
}
.regs-content ul { padding-left: 20px; margin-bottom: 15px; }
.regs-content h4 { margin-top: 15px; margin-bottom: 5px; color: var(--eb-dark); }

/* Success Modal Specifics */
.success-content { text-align: center; padding: 20px; }
.success-icon { font-size: 4rem; color: #27ae60; margin-bottom: 20px; display: block; }
.success-title { font-size: 1.5rem; color: var(--eb-dark); margin-bottom: 10px; }
.success-msg { font-size: 1rem; color: #666; margin-bottom: 30px; }

/* =========================================
   PART B: ADMIN RECORDS (visitorforms.php)
   ========================================= */

.main-header { background-color: var(--pistachio-dark); width: 100%; position: sticky; top: 0; z-index: 1000; box-shadow: var(--shadow); margin-bottom: 30px; }
.header-content { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; max-width: 1400px; margin: 0 auto; width: 100%; }
.header-left { display: flex; align-items: center; gap: 20px; }
.nav-logo { height: 60px; width: auto; }
.page-title { font-size: 1.8rem; font-weight: 700; color: var(--eb-dark); margin: 0; line-height: 1; }
.back-btn { color: var(--eb-dark); font-size: 1.2rem; text-decoration: none; display: flex; align-items: center; gap: 8px; font-weight: 600; }

.records-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px 40px 20px; flex: 1; }
.sticky-filter-bar { background: var(--white); padding: 15px; border-radius: 8px; box-shadow: var(--shadow); display: flex; justify-content: center; gap: 15px; margin-bottom: 20px; border-top: 4px solid var(--pistachio-dark); }

.search-wrap { position: relative; width: 300px; }
.search-wrap i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #999; }
.search-wrap input { width: 100%; padding: 10px 15px 10px 40px; border-radius: 5px; border: 1px solid #ccc; outline: none; }
.date-input { border-radius: 5px; border: 1px solid #ccc; padding: 10px 20px; outline: none; }

.table-wrapper { background: var(--white); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); border-top: 4px solid var(--eb-dark); }
.log-table { width: 100%; border-collapse: collapse; }
.log-table th { background: var(--eb-dark); color: var(--white); padding: 15px; text-align: left; font-weight: 600; text-transform: uppercase; font-size: 0.85rem; }
.log-table td { padding: 15px; border-bottom: 1px solid #eee; color: #333; }
.log-table tr:hover { background: #f1f7ed; cursor: pointer; }

.pagination { display: flex; justify-content: center; gap: 15px; margin-top: 30px; align-items: center; }
.page-link { text-decoration: none; color: var(--eb-dark); padding: 8px 16px; border: 1px solid #ddd; background: var(--white); border-radius: 4px; }
.page-link:hover:not(.disabled) { background: var(--pistachio-dark); color: white; }
.page-link.disabled { opacity: 0.5; cursor: not-allowed; background: #eee; }

/* Modal */
.glass-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.glass-modal { background: var(--white); padding: 30px; border-radius: 10px; border-top: 5px solid var(--pistachio-dark); box-shadow: 0 10px 40px rgba(0,0,0,0.2); max-width: 800px; width: 90%; text-align: left; max-height: 90vh; overflow-y: auto; position: relative; }
.close-modal { position: absolute; top: 15px; right: 20px; font-size: 28px; cursor: pointer; color: #999; }
.close-modal:hover { color: var(--danger); }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; background: #f9f9f9; padding: 20px; border-radius: 8px; margin-bottom: 25px; border: 1px solid #eee; }
.info-item strong { font-size: 0.8rem; text-transform: uppercase; color: #7f8c8d; display: block; margin-bottom: 5px; }
.info-item { font-size: 1.1rem; color: var(--eb-dark); font-weight: 500; }
.health-section h3 { color: var(--eb-dark); font-size: 1.1rem; margin-bottom: 15px; text-transform: uppercase; border-bottom: 2px solid #eee; padding-bottom: 10px; }
.health-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 0.95rem; }
.val-yes { color: var(--danger); font-weight: 700; background: #ffe6e6; padding: 2px 8px; border-radius: 4px; }
.val-no { color: #27ae60; font-weight: 600; }
.signature-view { margin-top: 25px; border: 2px dashed #cbd5e1; padding: 20px; border-radius: 8px; text-align: center; background: #fafafa; }

/* Admin Delete & Modal Buttons */
.delete-btn {
    background-color: var(--danger);
    color: var(--white);
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    width: 100%;
    margin-top: 20px;
    cursor: pointer;
    transition: background 0.2s;
}
.delete-btn:hover { background-color: #c0392b; }

.modal-btn-row { display: flex; justify-content: center; gap: 15px; margin-top: 20px; }
.modal-btn {
    padding: 10px 20px; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.btn-cancel { background: #e0e0e0; color: #333; }
.btn-cancel:hover { background: #d0d0d0; }
.btn-confirm-delete { background: var(--danger); color: white; }
.btn-confirm-delete:hover { background: #c0392b; }

@media (max-width: 768px) {
    .input-grid, .info-grid { grid-template-columns: 1fr; }
    .header-content { flex-direction: column; gap: 10px; }
    .form-container { width: 95%; margin: 20px auto; padding: 20px; }
}