/**
 * Voxel Events - Frontend Check-in Widget Styles
 */

.ve-checkin-widget {
    font-family: inherit;
}

.ve-checkin-title {
    margin: 0 0 20px;
    font-size: 1.5em;
    font-weight: 600;
}

/* Stats */
.ve-checkin-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.ve-stat {
    flex: 1;
    text-align: center;
}

.ve-stat-value {
    display: block;
    font-size: 2em;
    font-weight: 700;
    line-height: 1.2;
}

.ve-stat-value.stat-checked {
    color: #00a32a;
}

.ve-stat-value.stat-remaining {
    color: #dba617;
}

.ve-stat-label {
    display: block;
    font-size: 0.85em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tabs */
.ve-checkin-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.ve-tab-btn {
    flex: 1;
    padding: 12px 15px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
}

.ve-tab-btn:hover {
    color: #2271b1;
}

.ve-tab-btn.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
}

.ve-tab-content {
    display: none;
}

.ve-tab-content.active {
    display: block;
}

/* Scanner */
.ve-scanner-container {
    text-align: center;
    padding: 10px 0;
}

#ve-qr-reader {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 15px;
    border-radius: 8px;
    overflow: hidden;
}

.ve-scanner-controls {
    margin-bottom: 10px;
}

.ve-scanner-hint {
    font-size: 0.9em;
    color: #666;
    margin: 0;
}

.ve-scanner-status {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    font-weight: 500;
}

.ve-scanner-status.success {
    background: #d4edda;
    color: #155724;
}

/* Search */
.ve-checkin-search {
    display: flex;
    gap: 10px;
}

.ve-checkin-input {
    flex: 1;
    padding: 12px 15px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: border-color 0.2s;
}

.ve-checkin-input:focus {
    outline: none;
    border-color: #2271b1;
}

.ve-checkin-btn {
    padding: 12px 25px;
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    background: #2271b1;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ve-checkin-btn:hover {
    background: #135e96;
}

.ve-checkin-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

/* Ticket Result */
.ve-ticket-result {
    margin-bottom: 25px;
}

.ve-ticket-card {
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.ve-ticket-card.ve-ticket-ready {
    border-color: #2271b1;
}

.ve-ticket-card.ve-ticket-checked-in {
    border-color: #00a32a;
    background: #f0f9f0;
}

.ve-ticket-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 15px;
}

.ve-status-ready {
    background: #e7f3ff;
    color: #2271b1;
}

.ve-status-success {
    background: #d4edda;
    color: #155724;
}

.ve-ticket-code {
    font-family: monospace;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.ve-ticket-details {
    margin-bottom: 15px;
}

.ve-ticket-details p {
    margin: 5px 0;
    font-size: 0.95em;
}

.ve-ticket-details strong {
    color: #666;
}

.ve-ticket-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.ve-btn-checkin {
    padding: 10px 25px;
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    background: #00a32a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ve-btn-checkin:hover {
    background: #007d1e;
}

.ve-btn-checkin:disabled {
    background: #999;
    cursor: not-allowed;
}

.ve-btn-clear {
    padding: 10px 20px;
    font-size: 0.95em;
    color: #666;
    background: #f0f0f1;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ve-btn-clear:hover {
    background: #ddd;
}

/* Error/Loading states */
.ve-error {
    padding: 15px;
    background: #fef0f0;
    border: 1px solid #f5c2c2;
    border-radius: 6px;
    color: #cc1818;
}

.ve-loading {
    color: #666;
    font-style: italic;
}

/* Recent Check-ins */
.ve-recent-checkins {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.ve-recent-checkins h4 {
    margin: 0 0 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.ve-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ve-recent-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f1;
    gap: 12px;
}

.ve-recent-item:last-child {
    border-bottom: none;
}

.ve-recent-name {
    flex: 1;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ve-recent-code {
    flex-shrink: 0;
    width: 110px;
    text-align: center;
    font-family: monospace;
    font-size: 0.85em;
    color: #666;
    background: #f0f0f1;
    padding: 3px 8px;
    border-radius: 3px;
}

.ve-recent-time {
    flex-shrink: 0;
    width: 70px;
    text-align: right;
    font-size: 0.85em;
    color: #999;
}

.ve-no-checkins {
    color: #666;
    font-style: italic;
}

/* No Access */
.ve-checkin-no-access {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    color: #666;
}

/* Scan Popup */
.ve-scan-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    box-sizing: border-box;
}

.ve-scan-popup {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: ve-popup-in 0.2s ease-out;
}

@keyframes ve-popup-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ve-scan-popup-header {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.ve-scan-popup-header.ve-scan-ready {
    background: #e7f3ff;
}

.ve-scan-popup-header.ve-scan-success {
    background: #d4edda;
}

.ve-scan-popup-header.ve-scan-already-checked {
    background: #fff3cd;
}

.ve-scan-popup-header.ve-scan-error {
    background: #f8d7da;
}

.ve-scan-popup-icon {
    display: block;
    font-size: 2.5em;
    margin-bottom: 8px;
}

.ve-scan-ready .ve-scan-popup-icon {
    color: #2271b1;
}

.ve-scan-success .ve-scan-popup-icon {
    color: #00a32a;
}

.ve-scan-already-checked .ve-scan-popup-icon {
    color: #856404;
}

.ve-scan-error .ve-scan-popup-icon {
    color: #cc1818;
}

.ve-scan-popup-title {
    display: block;
    font-size: 1.2em;
    font-weight: 600;
    color: #1a1a1a;
}

.ve-scan-popup-body {
    padding: 20px;
}

.ve-scan-loading {
    text-align: center;
    padding: 20px 0;
}

.ve-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 3px solid #eee;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: ve-spin 0.8s linear infinite;
}

@keyframes ve-spin {
    to {
        transform: rotate(360deg);
    }
}

.ve-scan-code {
    font-family: monospace;
    font-size: 1.3em;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 15px;
}

.ve-scan-message {
    text-align: center;
    margin-bottom: 15px;
    color: #666;
}

.ve-scan-details {
    font-size: 0.95em;
}

.ve-scan-detail {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f1;
}

.ve-scan-detail:last-child {
    border-bottom: none;
}

.ve-scan-detail strong {
    color: #666;
    display: inline-block;
    min-width: 80px;
}

.ve-scan-popup-actions {
    display: flex;
    gap: 10px;
    padding: 15px 20px 20px;
    border-top: 1px solid #eee;
}

.ve-scan-btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.ve-scan-btn-primary {
    background: #00a32a;
    color: #fff;
}

.ve-scan-btn-primary:hover {
    background: #007d1e;
}

.ve-scan-btn-secondary {
    background: #f0f0f1;
    color: #1a1a1a;
}

.ve-scan-btn-secondary:hover {
    background: #ddd;
}

.ve-scan-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 600px) {
    .ve-checkin-stats {
        flex-direction: column;
        gap: 10px;
    }

    .ve-stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .ve-stat-value {
        font-size: 1.5em;
    }

    .ve-checkin-search {
        flex-direction: column;
    }

    .ve-ticket-actions {
        flex-direction: column;
    }

    .ve-scan-popup {
        max-width: 100%;
    }

    .ve-scan-popup-actions {
        flex-direction: column;
    }
}
