/**
 * Registration Overview Styles
 *
 * Styles for the [registration_overview] shortcode
 * Includes responsive design and print-friendly layout
 */

/* Container */
.vilstaler-registration-overview {
    font-family: 'Lato', sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Controls Section */
.registration-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.ride-selector-wrapper {
    flex: 1;
    min-width: 250px;
}

.ride-selector-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.ride-selector {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.ride-selector:hover,
.ride-selector:focus {
    border-color: var(--color-primary);
    outline: none;
}

.print-button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--color-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.print-button:hover {
    background: #1e4080;
}

.print-button:active {
    background: #163060;
}

/* Summary Section */
.registration-summary {
    margin-bottom: 20px;
    padding: 20px;
    background: #e8f4f8;
    border-left: 4px solid var(--color-primary);
    border-radius: 0 8px 8px 0;
}

.ride-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #333;
}

.registration-count-display {
    font-size: 18px;
}

.count-label {
    color: #666;
}

.count-value {
    font-weight: 700;
    color: var(--color-primary);
    margin-left: 8px;
}

/* Category Counts */
.registration-category-counts {
    margin-top: 10px;
    font-size: 15px;
    color: #555;
}

.category-count {
    margin-right: 20px;
}

.category-count strong {
    color: var(--color-primary);
}

/* Loading State */
.registration-loading {
    padding: 40px;
    text-align: center;
    font-size: 16px;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Empty State */
.registration-empty {
    padding: 40px;
    text-align: center;
    font-size: 16px;
    color: #666;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
}

/* Error State */
.vilstaler-error {
    padding: 20px;
    color: var(--color-error);
    background: var(--color-error-bg);
    border: 1px solid #f5c6cb;
    border-radius: 8px;
}

/* Table Wrapper */
.registration-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

/* Table Styles */
.registration-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.registration-table thead {
    background: var(--color-primary);
    color: #fff;
}

.registration-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.registration-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.15s ease;
}

.registration-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.registration-table tbody tr:hover {
    background: #e8f4f8;
}

.registration-table td {
    padding: 12px;
    font-size: 14px;
    color: #333;
    vertical-align: middle;
}

/* Column Widths */
.col-name {
    min-width: 150px;
}

.col-email {
    min-width: 180px;
}

.col-phone {
    min-width: 120px;
}

.col-birth {
    min-width: 80px;
}

.col-member {
    min-width: 80px;
}

/* Action Buttons Wrapper */
.action-buttons-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

/* Close Registration Button */
.close-registration-button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-primary);
    background: #fff;
    border: 2px solid var(--color-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.close-registration-button:hover:not(:disabled) {
    background: var(--color-primary);
    color: #fff;
}

.close-registration-button:active:not(:disabled) {
    background: #1e4080;
    border-color: #1e4080;
    color: #fff;
}

.close-registration-button:disabled,
.close-registration-button.disabled {
    background: #f5f5f5;
    border-color: #ccc;
    color: #888;
    cursor: not-allowed;
}

/* Cancel Registration Button */
.cancel-registration-button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #c9302c;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.cancel-registration-button:hover:not(:disabled) {
    background: #ac2925;
}

.cancel-registration-button:active:not(:disabled) {
    background: #8b211e;
}

.cancel-registration-button:disabled,
.cancel-registration-button.disabled {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Confirmation Modal */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirmation-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.confirmation-modal-content {
    position: relative;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    text-align: center;
    z-index: 1;
}

.confirmation-message {
    font-size: 18px;
    color: #333;
    margin: 0 0 25px 0;
    line-height: 1.5;
}

.confirmation-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-yes-button {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #c9302c;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.confirm-yes-button:hover {
    background: #ac2925;
}

.confirm-no-button {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: #e0e0e0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.confirm-no-button:hover {
    background: #d0d0d0;
}

.col-departure {
    min-width: 120px;
}

.col-date {
    min-width: 140px;
}

.col-action {
    width: 50px;
    text-align: center;
}

/* Strikethrough Button */
.strikethrough-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    color: #666;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.strikethrough-btn:hover {
    background: #e8e8e8;
    color: #333;
    border-color: #ccc;
}

.strikethrough-btn:active {
    background: #ddd;
}

.strikethrough-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Strikethrough Row */
.registration-table tbody tr.strikethrough {
    background: #f9f9f9 !important;
}

.registration-table tbody tr.strikethrough td {
    text-decoration: line-through;
    color: #999;
}

.registration-table tbody tr.strikethrough .col-action {
    text-decoration: none;
}

.registration-table tbody tr.strikethrough .strikethrough-btn {
    background: #c9302c;
    color: #fff;
    border-color: #c9302c;
}

.registration-table tbody tr.strikethrough .strikethrough-btn:hover {
    background: #ac2925;
    border-color: #ac2925;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .vilstaler-registration-overview {
        padding: 10px;
    }

    .registration-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .ride-selector-wrapper {
        min-width: 100%;
    }

    .print-button {
        width: 100%;
    }

    .action-buttons-wrapper {
        flex-direction: column;
    }

    .action-buttons-wrapper button {
        width: 100%;
    }

    .registration-table th,
    .registration-table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .confirmation-modal-content {
        padding: 20px;
        margin: 15px;
    }

    .confirmation-message {
        font-size: 16px;
    }

    .confirmation-buttons {
        flex-direction: column;
    }

    .confirm-yes-button,
    .confirm-no-button {
        width: 100%;
    }
}

@media screen and (max-width: 580px) {
    .ride-title {
        font-size: 20px;
    }

    .registration-count-display {
        font-size: 16px;
    }

    /* Stack table for mobile */
    .registration-table thead {
        display: none;
    }

    .registration-table tbody tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 12px;
        background: #fff;
    }

    .registration-table tbody tr:nth-child(even) {
        background: #fff;
    }

    .registration-table td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #eee;
        text-align: right;
    }

    .registration-table td:last-child {
        border-bottom: none;
    }

    .registration-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        margin-right: 10px;
        text-align: left;
    }

    /* Action column on mobile */
    .registration-table td.col-action {
        justify-content: flex-end;
        border-bottom: none;
        padding-top: 12px;
    }

    .registration-table td.col-action::before {
        display: none;
    }

    /* Action buttons full width on mobile */
    .action-buttons-wrapper {
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    /* Hide non-printable elements */
    .no-print,
    .registration-controls,
    .col-action {
        display: none !important;
    }

    /* Reset page margins */
    @page {
        margin: 1.5cm;
        size: landscape;
    }

    /* Container reset */
    .vilstaler-registration-overview {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }

    /* Summary section for print */
    .registration-summary {
        background: none !important;
        border: none !important;
        padding: 0 0 20px 0;
        margin-bottom: 20px;
        border-bottom: 2px solid #000 !important;
    }

    .ride-title {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .registration-count-display {
        font-size: 14px;
    }

    /* Table print styles */
    .registration-table-wrapper {
        overflow: visible;
    }

    .registration-table {
        box-shadow: none;
        border: 1px solid #000;
        border-radius: 0;
        font-size: 11px;
    }

    .registration-table thead {
        background: #eee !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .registration-table th {
        padding: 8px 6px;
        font-size: 11px;
        border: 1px solid #000;
    }

    .registration-table td {
        padding: 6px;
        font-size: 10px;
        border: 1px solid #000;
    }

    .registration-table tbody tr {
        page-break-inside: avoid;
    }

    .registration-table tbody tr:nth-child(even) {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Ensure table header repeats on each page */
    .registration-table thead {
        display: table-header-group;
    }

    /* Hide loading and empty states */
    .registration-loading,
    .registration-empty {
        display: none !important;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .registration-table tbody tr,
    .ride-selector,
    .print-button {
        transition: none;
    }
}
