/* register-styles.css - สำหรับหน้าลงทะเบียนทั้งหมด */

/* ===== RESET & BASE STYLES ===== */
.register-container {
    margin-top: 50px;
    padding: 0 15px;
    transition: margin-top 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.header-scrolled .register-container {
    margin-top: 50px;
}

.register-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ===== BREADCRUMB ===== */
.register-breadcrumb {
    padding: 15px 0;
    margin-bottom: 25px;
    border-bottom: 1px solid #e9ecef;
    background: transparent;
}

.register-breadcrumb .breadcrumb {
    background: transparent;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.register-breadcrumb .breadcrumb > li + li:before {
    content: "›";
    color: #6c757d;
    padding: 0 8px;
}

.register-breadcrumb .breadcrumb li.active {
    color: #a92928;
    font-weight: 600;
}

/* ===== FORM CONTAINER ===== */
.register-form-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid #e9ecef;
}

.register-header {
    margin-bottom: 25px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.register-header h1 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.register-header .subtitle {
    color: #6c757d;
    font-size: 15px;
    margin-top: 8px;
    line-height: 1.5;
}

/* ===== FORM STYLES ===== */
.register-form {
    margin-top: 20px;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4361ee;
}

.form-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title i {
    color: #4361ee;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: block;
    font-size: 15px;
}

.form-label.required:after {
    content: " *";
    color: #dc3545;
}

.form-control {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 15px;
    transition: all 0.3s;
    height: auto;
    min-height: 46px;
}

.form-control:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
    outline: none;
}

.form-control[type="file"] {
    padding: 10px;
    height: auto;
}

/* ===== RADIO BUTTONS ===== */
.radio-group {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-option label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    font-size: 15px;
}

/* ===== IMAGE UPLOAD ===== */
.image-upload-container {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s;
    margin-top: 10px;
}

.image-upload-container:hover {
    border-color: #4361ee;
    background: #f0f3ff;
}

.upload-preview {
    margin-top: 20px;
    text-align: center;
}

.upload-preview img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.upload-info {
    margin-top: 15px;
    color: #6c757d;
    font-size: 14px;
}

.upload-info i {
    color: #4361ee;
    margin-right: 5px;
}

/* ===== PRISONER TABLE (สำหรับ register.php) ===== */
.prisoner-table-container {
    margin: 30px 0;
    overflow-x: auto;
}

.prisoner-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.prisoner-table thead {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

.prisoner-table th {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 3px solid #a92928;
}

.prisoner-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

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

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

.prisoner-table input,
.prisoner-table select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.table-action-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-add-row {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add-row:hover {
    background: #218838;
}

.btn-delete-row {
    background: #dc3545;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-delete-row:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* ===== FORM ACTIONS ===== */
.form-actions {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.btn-submit {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 14px 35px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(40, 167, 69, 0.4);
}

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 14px 35px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 180px;
    margin-left: 15px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cancel:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

/* ===== ALERTS & NOTES ===== */
.form-alert {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.form-alert i {
    color: #ffc107;
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.form-alert p {
    margin: 0;
    color: #856404;
    font-size: 14px;
    line-height: 1.5;
}

.form-note {
    color: #6c757d;
    font-size: 13px;
    margin-top: 8px;
    line-height: 1.5;
    font-style: italic;
}

/* ===== VALIDATION STYLES ===== */
input:invalid,
select:invalid {
    border-color: #dc3545;
}

input:valid,
select:valid {
    border-color: #28a745;
}

.error-message {
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* ===== LOADING STATE ===== */
.btn-submit.loading {
    position: relative;
    color: transparent;
}

.btn-submit.loading:after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== VERTICAL PRISONER FORM ===== */
.prisoner-vertical-container {
    margin: 30px 0;
}

.prisoner-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
}

.prisoner-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-color: #4361ee;
}

.prisoner-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.prisoner-number {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prisoner-number-badge {
    background: #4361ee;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.prisoner-number-text {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.btn-remove-prisoner {
    background: #dc3545;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-remove-prisoner:hover {
    background: #c82333;
    transform: scale(1.1);
}

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

.prisoner-card.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
}

.prisoner-card.empty-state i {
    font-size: 48px;
    color: #adb5bd;
    margin-bottom: 15px;
}

.prisoner-card.empty-state h4 {
    color: #6c757d;
    margin-bottom: 10px;
    font-weight: 600;
}

.prisoner-card.empty-state p {
    color: #6c757d;
    margin-bottom: 20px;
}

/* ปุ่มเพิ่มผู้ต้องขัง */
.btn-add-prisoner-container {
    text-align: center;
    margin: 30px 0;
}

.btn-add-prisoner {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.btn-add-prisoner:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(67, 97, 238, 0.4);
}

.prisoner-form-note {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px 20px;
    margin-top: 20px;
    border-left: 4px solid #4361ee;
}

.prisoner-form-note p {
    margin: 0;
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
}

.prisoner-form-note i {
    color: #4361ee;
    margin-right: 10px;
}

/* ===== TICKET STYLES ===== */
/* Ticket Alert */
.ticket-alert {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0 30px 0;
}

.ticket-alert i {
    color: #ffc107;
    font-size: 24px;
}

.ticket-alert p {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Ticket Stats */
.ticket-stats {
    display: flex;
    justify-content: center;
    margin: 25px 0 35px 0;
}

.ticket-stat-card {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    border-radius: 16px;
    padding: 25px 35px;
    display: flex;
    align-items: center;
    gap: 25px;
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.25);
    transition: transform 0.3s ease;
}

.ticket-stat-card:hover {
    transform: translateY(-5px);
}

.ticket-stat-card .stat-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.ticket-stat-card .stat-details {
    display: flex;
    flex-direction: column;
}

.ticket-stat-card .stat-value {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
}

.ticket-stat-card .stat-label {
    font-size: 16px;
    opacity: 0.9;
    margin-top: 5px;
}

/* Ticket Grid */
.ticket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

/* Ticket Card */
.ticket-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ticket-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Status Border Colors */
.ticket-card.status-approved {
    border-top: 6px solid #28a745;
}

.ticket-card.status-rejected {
    border-top: 6px solid #dc3545;
}

.ticket-card.status-pending {
    border-top: 6px solid #ffc107;
}

.ticket-card.status-checked-in {
    border-top: 6px solid #17a2b8;
}

.ticket-card.status-cancelled {
    border-top: 6px solid #6c757d;
}

/* Ticket Header */
.ticket-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px;
}

.ticket-title {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.ticket-icon {
    background: #4361ee;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.ticket-info {
    flex: 1;
}

.ticket-name {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.ticket-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

.ticket-status {
    display: flex;
    align-items: flex-start;
}

.status-badge {
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Status badge colors */
.badge-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: 2px solid #28a745;
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: 2px solid #dc3545;
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
    border: 2px solid #ffc107;
}

.badge-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: 2px solid #17a2b8;
}

.badge-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: 2px solid #6c757d;
}

/* สไตล์สถานะตามสีต้นฉบับ */
.status-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-secondary {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* Ticket Body */
.ticket-body {
    padding: 25px 20px;
    flex: 1;
}

.ticket-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

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

.detail-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 15px;
    color: #212529;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-value i {
    color: #4361ee;
    font-size: 16px;
    width: 20px;
}

/* รายการที่กว้างเต็มคอลัมน์ */
.time-detail,
.prisoner-detail,
.relative-detail {
    grid-column: span 1;
}

.time-detail .detail-value {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.date-main {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
}

.date-sub {
    font-size: 13px;
    color: #6c757d;
}

.prisoner-info,
.relative-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.prisoner-name,
.relative-name {
    font-weight: 600;
    color: #2c3e50;
}

.prisoner-id,
.relative-relation {
    font-size: 13px;
    color: #6c757d;
}

/* Ticket Note */
.ticket-note {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid #ffc107;
    margin-top: 20px;
}

.note-label {
    font-size: 13px;
    font-weight: 600;
    color: #856404;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-label i {
    color: #ffc107;
}

.note-content {
    font-size: 14px;
    color: #856404;
    line-height: 1.5;
    padding-left: 24px;
}

/* Ticket Footer */
.ticket-footer {
    padding: 20px;
    border-top: 2px dashed #dee2e6;
    background: #f8f9fa;
}

.ticket-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ticket-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    flex: 1;
    min-width: 140px;
    justify-content: center;
    text-align: center;
}

.btn-view-ticket {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.btn-view-ticket:hover {
    background: linear-gradient(135deg, #3a0ca3 0%, #2c0880 100%);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(67, 97, 238, 0.4);
}

.btn-cancel-ticket {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-cancel-ticket:hover {
    background: linear-gradient(135deg, #c82333 0%, #b21f2d 100%);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(220, 53, 69, 0.4);
}

/* Empty State */
.ticket-empty-state {
    text-align: center;
    padding: 60px 30px;
    background: #f8f9fa;
    border-radius: 16px;
    border: 3px dashed #dee2e6;
    margin: 40px 0;
}

.ticket-empty-state .empty-icon {
    font-size: 80px;
    color: #adb5bd;
    margin-bottom: 25px;
    opacity: 0.7;
}

.ticket-empty-state h3 {
    color: #6c757d;
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 28px;
}

.ticket-empty-state p {
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 18px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary-ticket {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 14px 35px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.btn-primary-ticket:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.4);
    color: white;
    text-decoration: none;
}

/* ===== RESPONSIVE DESIGN ===== */

/* สำหรับมือถือให้แสดงทีละคอลัมน์ */
@media (max-width: 768px) {
    .prisoner-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .register-container {
        margin-top: 40px;
    }
    
    .header-scrolled .register-container {
        margin-top: 40px;
    }
    
    .register-form-container {
        padding: 20px;
    }
    
    .register-header h1 {
        font-size: 20px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .form-section-title {
        font-size: 16px;
    }
    
    .prisoner-table {
        display: block;
    }
    
    .prisoner-table th,
    .prisoner-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .prisoner-table input,
    .prisoner-table select {
        padding: 8px;
        font-size: 13px;
    }
    
    .btn-submit,
    .btn-cancel {
        width: 100%;
        margin: 10px 0;
        padding: 12px;
    }
    
    .btn-cancel {
        margin-left: 0;
    }
    
    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .register-container {
        margin-top: 50px;
        padding: 0 10px;
    }
    
    .header-scrolled .register-container {
        margin-top: 40px;
    }
    
    .register-form-container {
        padding: 15px;
    }
    
    .image-upload-container {
        padding: 15px;
    }
    
    .upload-preview img {
        max-height: 180px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-submit, .btn-cancel {
        width: 100%;
        margin: 5px 0;
    }
    
    .prisoner-form-grid {
        gap: 15px;
    }
}

/* ===== RESPONSIVE TICKET DESIGN ===== */
@media (min-width: 1400px) {
    .ticket-grid {
        grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
        gap: 30px;
    }
}

@media (max-width: 1200px) {
    .ticket-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 992px) {
    .ticket-grid {
        grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
        gap: 20px;
    }
}

/* MOBILE: 2 คอลัมน์ */
@media (max-width: 768px) {
    .ticket-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 15px;
    }
    
    .ticket-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .ticket-title {
        width: 100%;
    }
    
    .ticket-status {
        width: 100%;
        justify-content: flex-start;
    }
    
    .status-badge {
        width: 100%;
        justify-content: center;
    }
    
    .ticket-body {
        padding: 20px 15px;
    }
    
    .ticket-details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .time-detail,
    .prisoner-detail,
    .relative-detail {
        grid-column: span 2;
    }
    
    .ticket-actions {
        flex-direction: column;
    }
    
    .ticket-btn {
        width: 100%;
    }
}

/* MOBILE: 3 คอลัมน์สำหรับหน้าจอเล็ก */
@media (max-width: 576px) {
    .ticket-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
    }
    
    .ticket-details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .detail-label {
        font-size: 11px;
    }
    
    .detail-value {
        font-size: 14px;
        gap: 8px;
    }
    
    .date-main {
        font-size: 16px;
    }
    
    .ticket-btn {
        min-width: auto;
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* MOBILE: 3 คอลัมน์เมื่อหน้าจอกว้างเพียงพอ */
@media (max-width: 480px) and (min-width: 375px) {
    .ticket-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 374px) {
    .ticket-grid {
        grid-template-columns: 1fr;
    }
    
    .ticket-details-grid {
        grid-template-columns: 1fr;
    }
    
    .time-detail,
    .prisoner-detail,
    .relative-detail {
        grid-column: span 1;
    }
}

/* สำหรับมือถือ: 2-3 คอลัมน์ */
@media (max-width: 480px) {
    .ticket-details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* ปรับปรุง responsive สำหรับการ์ด */
@media (max-width: 768px) {
    .prisoner-card {
        padding: 15px;
    }
    
    .prisoner-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .status-badge {
        min-width: 100px;
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .prisoner-number {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ===== TICKET LAYOUT ENHANCEMENTS ===== */
/* สำหรับหน้าจอใหญ่ให้แสดง 3 คอลัมน์ */
@media (min-width: 1600px) {
    .ticket-grid {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }
}

/* สำหรับหน้าจอกลางให้แสดง 2-3 คอลัมน์ */
@media (min-width: 1200px) and (max-width: 1599px) {
    .ticket-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}

/* สำหรับ Tablet ให้แสดง 2 คอลัมน์ */
@media (min-width: 768px) and (max-width: 1199px) {
    .ticket-grid {
       grid-template-columns: 1fr;
    }
}

/* สำหรับ Mobile ให้แสดง 2 คอลัมน์ */
@media (max-width: 767px) {
    .ticket-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .ticket-card {
        min-height: 320px;
    }
    
    .ticket-details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .time-detail,
    .prisoner-detail {
        grid-column: span 2;
    }
}

/* สำหรับ Mobile ขนาดเล็กมาก */
@media (max-width: 480px) {
    .ticket-grid {
        grid-template-columns: 1fr;
    }
    
    .ticket-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .time-detail,
    .prisoner-detail,
    .relative-detail {
        grid-column: span 2;
    }
}

/* ปรับให้เหมือนกับหน้า Categorie */
.register-header {
    text-align: center;
    margin-bottom: 30px;
}

.register-header h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.register-header .subtitle {
    color: #6c757d;
    font-size: 16px;
}

/* ปรับ Form Actions ให้สวยงาม */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.btn-submit, .btn-cancel {
    min-width: 200px;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-submit:hover, .btn-cancel:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ===== WIDE LAYOUT ADJUSTMENTS ===== */
.info-page .register-content {
    max-width: 1600px;
    width: 100%;
}

.info-page .register-form-container {
    width: 100%;
    max-width: 100%;
}

/* ปรับการแสดงผลบนหน้าจอขนาดใหญ่ */
@media (min-width: 1400px) {
    .booking-info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1600px) {
    .info-page .register-content {
        max-width: 1800px;
    }
}

/* ปรับให้ตารางไม่แคบเกินไปบนหน้าจอใหญ่ */
.prisoner-table-container {
    width: 100%;
    overflow-x: auto;
}

.prisoner-table {
    min-width: 800px;
}

/* ปรับ padding บนหน้าจอใหญ่ */
@media (min-width: 1200px) {
    .register-content {
        padding: 0 30px;
    }
    
    .register-form-container {
        padding: 40px;
    }
}

/* ปรับการแสดงผลของการ์ดบนหน้าจอใหญ่ */
@media (min-width: 1400px) {
    .prisoner-form-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== ANIMATIONS ===== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* แอนิเมชั่นสำหรับการเพิ่ม/ลบการ์ด */
.prisoner-card.adding {
    animation: slideDown 0.3s ease-out;
}

.prisoner-card.removing {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* ===== PRINT STYLES ===== */
@media print {
    .register-breadcrumb,
    .form-alert,
    .ticket-stats,
    .ticket-footer,
    .form-actions,
    .modern-simple-footer {
        display: none !important;
    }
    
    .register-container {
        margin-top: 0 !important;
        padding: 0 !important;
    }
    
    .register-form-container {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }
    
    .ticket-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .ticket-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        margin-bottom: 15px !important;
    }
    
    .ticket-header {
        background: #f8f9fa !important;
        color: #000 !important;
        border-bottom: 1px solid #ddd !important;
    }
    
    .ticket-icon {
        background: #ddd !important;
        color: #000 !important;
        border: 1px solid #999 !important;
    }
    
    .status-badge {
        background: #f8f9fa !important;
        color: #000 !important;
        border: 1px solid #ddd !important;
    }
}