/**
 * Tournament Registration Styles
 * 
 * @package AutoSportsTournament
 * @since 1.2.11
 */

/* ==========================================================================
   Container & Layout
   ========================================================================== */

.ast-reg-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ast-reg-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c00;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

/* ==========================================================================
   Header
   ========================================================================== */

.ast-reg-header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #001731 0%, #002347 100%);
    color: #fff;
    border-radius: 12px;
    margin-bottom: 24px;
}

.ast-reg-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.ast-reg-subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.85;
    color: #fff;
}

.ast-reg-description {
    margin-top: 16px;
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.6;
}

/* ==========================================================================
   Info Grid
   ========================================================================== */

.ast-reg-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ast-reg-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.ast-info-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.ast-info-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ast-info-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ast-info-value {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.ast-class-breakdown {
    display: flex;
    gap: 12px;
    font-size: 13px;
}

.ast-class-pro {
    color: #FD0020;
    font-weight: 600;
}

.ast-class-proam {
    color: #0057AB;
    font-weight: 600;
}

.ast-reg-breakdown {
    display: block;
    font-size: 11px;
    font-weight: 400;
    margin-top: 2px;
}

.ast-confirmed {
    color: #00a32a;
}

.ast-pending-text {
    color: #dba617;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.ast-reg-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.ast-reg-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

/* ==========================================================================
   Login / Discord Required States
   ========================================================================== */

.ast-reg-login-required,
.ast-reg-discord-required,
.ast-reg-inactive,
.ast-reg-closed {
    text-align: center;
    padding: 60px 30px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
}

.ast-reg-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.ast-reg-login-required h3,
.ast-reg-discord-required h3,
.ast-reg-inactive h3,
.ast-reg-closed h4 {
    margin: 0 0 12px 0;
    font-size: 22px;
    color: #1a1a2e;
}

.ast-reg-login-required p,
.ast-reg-discord-required p,
.ast-reg-inactive p,
.ast-reg-closed p {
    color: #666;
    margin: 0 0 20px 0;
    font-size: 15px;
}

/* ==========================================================================
   Driver Card
   ========================================================================== */

.ast-reg-driver-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ast-reg-driver-avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ast-reg-driver-info {
    flex: 1;
}

.ast-reg-driver-info h4 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.ast-driver-team {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #666;
}

.ast-driver-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ast-driver-class {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.ast-driver-class.ast-class-pro {
    background: linear-gradient(135deg, #FD0020 0%, #cc001a 100%);
    color: #fff;
}

.ast-driver-class.ast-class-proam {
    background: linear-gradient(135deg, #0057AB 0%, #004588 100%);
    color: #fff;
}

.ast-driver-number {
    font-weight: 700;
    color: #333;
    font-size: 14px;
}

.ast-reg-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    border-radius: 8px;
}

.ast-reg-status.ast-status-confirmed {
    background: #d4edda;
    color: #155724;
}

.ast-reg-status.ast-status-pending {
    background: #fff3cd;
    color: #856404;
}

.ast-status-icon {
    font-size: 24px;
}

.ast-status-text {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ==========================================================================
   Registration Form
   ========================================================================== */

.ast-reg-form {
    text-align: center;
}

.ast-reg-agree {
    margin-bottom: 20px;
    text-align: left;
}

.ast-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.ast-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.ast-checkbox-text {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

/* ==========================================================================
   Already Registered
   ========================================================================== */

.ast-reg-registered {
    text-align: center;
}

.ast-reg-confirmed-msg {
    font-size: 18px;
    color: #155724;
    background: #d4edda;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.ast-reg-pending-info {
    text-align: left;
    background: #fff3cd;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.ast-reg-pending-info p {
    margin: 0 0 12px 0;
}

.ast-reg-pending-info ul {
    margin: 0;
    padding-left: 20px;
}

.ast-reg-pending-info li {
    margin-bottom: 6px;
}

.ast-reg-date {
    font-size: 13px;
    color: #666;
}

/* ==========================================================================
   Race Schedule
   ========================================================================== */

.ast-reg-schedule {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ast-schedule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
}

.ast-schedule-round {
    font-weight: 700;
    color: #001731;
    min-width: 40px;
}

.ast-schedule-track {
    flex: 1;
    font-weight: 500;
}

.ast-schedule-date {
    font-size: 13px;
    color: #666;
}

/* Track thumbnail (v2.2.8) */
.ast-track-thumb-btn {
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    line-height: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ast-track-thumb-btn:hover,
.ast-track-thumb-btn:focus-visible {
    transform: scale(1.04);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    outline: 2px solid #3b5bdb;
    outline-offset: 2px;
}

.ast-track-thumb {
    display: block;
    width: 88px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* Placeholder keeps layout aligned when no image */
.ast-track-thumb-placeholder {
    flex-shrink: 0;
    display: block;
    width: 88px;
    height: 50px;
}

/* ==========================================================================
   Track Lightbox (v2.2.8)
   ========================================================================== */

.ast-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ast-lightbox[hidden] {
    display: none !important;
}

.ast-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    cursor: pointer;
}

.ast-lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
    animation: ast-lb-in 0.18s ease;
}

@keyframes ast-lb-in {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

.ast-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.ast-lightbox-label {
    margin: 10px 0 0;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.ast-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    color: #333;
    transition: background 0.12s ease;
}

.ast-lightbox-close:hover {
    background: #f0f0f0;
}

.ast-lightbox-body-lock {
    overflow: hidden;
}

/* Mobile: smaller thumb on narrow screens */
@media (max-width: 480px) {
    .ast-track-thumb,
    .ast-track-thumb-placeholder {
        width: 64px;
        height: 36px;
    }
}

/* ==========================================================================
   Registered Drivers List
   ========================================================================== */

.ast-reg-drivers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.ast-reg-driver-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.ast-reg-driver-item:hover {
    background: #e9ecef;
}

.ast-reg-driver-item.ast-pending {
    opacity: 0.6;
}

.ast-reg-driver-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.ast-reg-driver-name {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ast-reg-driver-class {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.ast-reg-driver-class.ast-class-pro {
    background: #FD0020;
    color: #fff;
}

.ast-reg-driver-class.ast-class-proam {
    background: #0057AB;
    color: #fff;
}

.ast-pending-badge {
    font-size: 14px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.ast-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ast-btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.ast-btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.ast-btn-primary {
    background: linear-gradient(135deg, #001731 0%, #002347 100%);
    color: #fff;
}

.ast-btn-primary:hover {
    background: linear-gradient(135deg, #002347 0%, #003366 100%);
    color: #fff;
    text-decoration: none;
}

.ast-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.ast-btn-secondary:hover {
    background: #e0e0e0;
    color: #333;
    text-decoration: none;
}

.ast-btn-discord {
    background: #5865F2;
    color: #fff !important;
}

.ast-btn-discord:hover {
    background: #4752c4;
    color: #fff !important;
    text-decoration: none;
}

.ast-btn-danger {
    background: #dc3545;
    color: #fff;
}

.ast-btn-danger:hover {
    background: #c82333;
    color: #fff;
}

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

/* ==========================================================================
   Messages
   ========================================================================== */

.ast-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.ast-message-text {
    flex: 1;
}

.ast-message-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 4px;
    color: inherit;
    transition: opacity 0.15s ease;
}

.ast-message-close:hover {
    opacity: 1;
}

.ast-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ast-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .ast-reg-container {
        padding: 12px;
    }
    
    .ast-reg-header {
        padding: 24px 16px;
    }
    
    .ast-reg-header h2 {
        font-size: 22px;
    }
    
    .ast-reg-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .ast-reg-info-card {
        padding: 12px;
    }
    
    .ast-reg-driver-card {
        flex-wrap: wrap;
    }
    
    .ast-reg-status {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        margin-top: 12px;
    }
    
    .ast-reg-drivers-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ast-reg-info-grid {
        grid-template-columns: 1fr;
    }
    
    .ast-class-breakdown {
        flex-direction: column;
        gap: 4px;
    }
}

/* Login/Registration Prompt */
.ast-reg-login-prompt {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.ast-reg-login-prompt .ast-reg-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.ast-reg-login-prompt p {
    color: #495057;
    margin: 0 0 16px 0;
    font-size: 16px;
}

.ast-reg-login-prompt .ast-btn {
    margin-top: 8px;
}

/* Guest Registration Form */
.ast-reg-guest-intro {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #4caf50;
}

.ast-reg-guest-intro p {
    margin: 0 0 8px 0;
    color: #2e7d32;
}

.ast-reg-guest-intro p:last-child {
    margin-bottom: 0;
}

.ast-guest-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
}

.ast-form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.ast-form-section-title:not(:first-of-type) {
    margin-top: 24px;
}

.ast-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.ast-form-group {
    display: flex;
    flex-direction: column;
}

.ast-form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 6px;
}

.ast-form-group label .required {
    color: #dc3545;
}

.ast-form-group input,
.ast-form-group select {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ast-form-group input:focus,
.ast-form-group select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.ast-form-group input::placeholder {
    color: #adb5bd;
}

.ast-field-hint {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

.ast-form-note {
    text-align: center;
    margin-top: 16px;
    color: #6c757d;
    font-size: 14px;
}

@media (max-width: 600px) {
    .ast-form-row {
        grid-template-columns: 1fr;
    }
    
    .ast-guest-form {
        padding: 16px;
    }
}

/* Registration Success Box (for guests who already registered) */
.ast-reg-success-box {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border: 1px solid #a5d6a7;
}

.ast-reg-success-box h4 {
    margin: 12px 0 8px 0;
    font-size: 20px;
    color: #2e7d32;
}

.ast-reg-success-box > p {
    margin: 0 0 20px 0;
    color: #333;
}

/* Next Steps */
.ast-reg-next-steps {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
    border: 1px solid #c8e6c9;
}

.ast-reg-next-steps h5 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #1b5e20;
}

.ast-reg-next-steps ol {
    margin: 0;
    padding-left: 20px;
}

.ast-reg-next-steps li {
    margin-bottom: 16px;
    padding-left: 8px;
}

.ast-reg-next-steps li:last-child {
    margin-bottom: 0;
}

.ast-reg-next-steps li strong {
    color: #333;
}

.ast-step-note {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.ast-reg-next-steps .ast-btn {
    margin-top: 8px;
}

/* Status Badge */
.ast-reg-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    margin: 16px 0;
}

.ast-reg-status-badge.ast-status-pending {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.ast-reg-status-badge.ast-status-confirmed {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.ast-reg-success-box .ast-reg-date {
    margin-top: 16px;
    font-size: 13px;
    color: #666;
}

/* Rules Link - v1.6.0 */
.ast-rules-link {
    margin: 10px 0 0 28px;
    font-size: 14px;
}

.ast-rules-link a {
    color: #0073aa;
    text-decoration: none;
}

.ast-rules-link a:hover {
    text-decoration: underline;
}
