/**
 * GSMTR Registration Form Styles
 */

/* Reset and base styles */
#gsmtr-registration-form {
    max-width: 800px;
    margin: 0 auto 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#gsmtr-registration-form *,
#gsmtr-registration-form *::before,
#gsmtr-registration-form *::after {
    box-sizing: border-box;
}

/* Event Info Banner */
.gsmtr-event-info {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.gsmtr-logo {
    width: 150px;
    height: auto;
    border-radius: 8px;
    flex-shrink: 0;
}

.gsmtr-event-description {
    flex: 1;
}

.gsmtr-event-description p {
    margin: 0 0 15px;
    line-height: 1.6;
}

.gsmtr-event-description ul {
    margin: 0 0 15px;
    padding-left: 20px;
}

.gsmtr-event-description li {
    margin-bottom: 5px;
}

.gsmtr-notice {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 4px solid #f39c12;
    font-size: 0.9em;
}

/* Sections */
.gsmtr-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.gsmtr-section-title {
    margin: 0 0 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gsmtr-section-icon {
    font-size: 1.2em;
}

.gsmtr-section-description {
    color: #666;
    margin: 0 0 20px;
    font-size: 0.95em;
    line-height: 1.5;
}

/* Driver Blocks */
.gsmtr-driver-block {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.gsmtr-driver-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.gsmtr-driver-header h4 {
    margin: 0;
    font-size: 1.1em;
    color: #2c3e50;
}

.gsmtr-remove-driver {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background 0.2s;
}

.gsmtr-remove-driver:hover {
    background: #c82333;
}

/* Form Fields */
.gsmtr-field-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.gsmtr-field {
    margin-bottom: 15px;
}

.gsmtr-field-half {
    flex: 1;
    margin-bottom: 0;
}

.gsmtr-field-third {
    width: 33%;
}

.gsmtr-field-inline {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gsmtr-field-small {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gsmtr-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #444;
    font-size: 0.95em;
}

.gsmtr-field-inline label,
.gsmtr-field-small label {
    margin-bottom: 0;
}

.gsmtr-field input[type="text"],
.gsmtr-field input[type="email"],
.gsmtr-field input[type="tel"],
.gsmtr-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gsmtr-field-inline select,
.gsmtr-field-small select {
    width: auto;
    min-width: 80px;
}

.gsmtr-field input:focus,
.gsmtr-field select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.gsmtr-field .required {
    color: #dc3545;
}

.gsmtr-field .optional {
    color: #6c757d;
    font-weight: normal;
    font-size: 0.85em;
}

.gsmtr-field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
}

/* Add Driver Button */
.gsmtr-add-button {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.gsmtr-add-button:hover {
    background: #218838;
}

.gsmtr-add-button:active {
    transform: scale(0.98);
}

/* Meal Tickets */
#gsmtr-meal-tickets-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.gsmtr-helper-text {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.gsmtr-meal-ticket-field {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.gsmtr-meal-ticket-field label {
    min-width: 120px;
    margin: 0;
    font-weight: 500;
    color: #444;
}

.gsmtr-meal-ticket-field input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
}

/* Raffle Options */
.gsmtr-raffle-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gsmtr-raffle-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.gsmtr-raffle-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gsmtr-raffle-price {
    font-weight: 600;
    color: #27ae60;
}

.gsmtr-raffle-savings {
    font-size: 0.85em;
    color: #28a745;
    background: #d4edda;
    padding: 3px 8px;
    border-radius: 4px;
}

/* T-Shirt Grid */
.gsmtr-tshirt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.gsmtr-tshirt-option {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.gsmtr-tshirt-option label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.gsmtr-tshirt-option select {
    width: 70px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 6px;
}

/* Price Summary */
.gsmtr-summary {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    padding: 25px 30px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.gsmtr-summary-title {
    margin: 0 0 20px;
    font-size: 1.2em;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#gsmtr-price-breakdown {
    margin-bottom: 20px;
}

.gsmtr-line-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gsmtr-line-item:last-child {
    border-bottom: none;
}

.gsmtr-item-name {
    flex: 1;
}

.gsmtr-item-qty {
    width: 50px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.gsmtr-item-price {
    width: 100px;
    text-align: right;
    font-weight: 500;
}

.gsmtr-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.gsmtr-total-label {
    font-size: 1.3em;
    font-weight: 600;
}

.gsmtr-total-price {
    font-size: 1.8em;
    font-weight: 700;
    transition: transform 0.3s, color 0.3s;
}

.gsmtr-total-price.gsmtr-price-updated {
    transform: scale(1.1);
    color: #2ecc71;
}

/* Add to Cart Button */
.gsmtr-add-to-cart {
    width: 100%;
    padding: 18px 30px !important;
    font-size: 1.2em !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #27ae60 !important;
    border: none !important;
    border-radius: 10px !important;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s !important;
}

.gsmtr-add-to-cart:hover {
    background: #229954 !important;
}

.gsmtr-add-to-cart:active {
    transform: scale(0.98);
}

/* Error Messages */
.gsmtr-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.gsmtr-general-error {
    position: relative;
    animation: gsmtr-shake 0.5s ease-in-out;
}

@keyframes gsmtr-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .gsmtr-event-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .gsmtr-logo {
        width: 120px;
    }

    .gsmtr-field-row {
        flex-direction: column;
        gap: 0;
    }

    .gsmtr-field-half,
    .gsmtr-field-third {
        width: 100%;
    }

    .gsmtr-raffle-option {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .gsmtr-raffle-info {
        flex-direction: column;
        gap: 8px;
    }

    .gsmtr-tshirt-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gsmtr-meal-ticket-field {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .gsmtr-meal-ticket-field label {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    #gsmtr-registration-form {
        margin: 0 -15px 30px;
    }

    .gsmtr-section,
    .gsmtr-event-info,
    .gsmtr-summary {
        border-radius: 0;
    }

    .gsmtr-tshirt-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Hide WooCommerce default elements on GSMTR products */
.gsmtr-cart-form .quantity {
    display: none !important;
}

.single-product .gsmtr-cart-form > .price {
    display: none !important;
}

/* Cart display styling */
.woocommerce-cart-form .gsmtr-cart-item-data dt {
    font-weight: 600;
    color: #333;
}

.woocommerce-cart-form .gsmtr-cart-item-data dd {
    color: #666;
    margin-bottom: 5px;
}

/* Additional Driver Notice */
.gsmtr-additional-driver-notice {
    margin-top: 20px;
    padding: 15px 20px;
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 8px;
    color: #004085;
    font-size: 0.95em;
    line-height: 1.5;
}

/* Field Notes (small helper text below inputs) */
.gsmtr-field-note {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

/* Collapsible Section Styling */
.gsmtr-section-collapsible .gsmtr-section-title {
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    user-select: none;
}

.gsmtr-section-collapsible .gsmtr-section-title:hover {
    opacity: 0.9;
}

.gsmtr-section-text {
    flex: 1;
}

.gsmtr-section-summary {
    font-size: 0.8em;
    font-weight: normal;
    color: #28a745;
    background: #e8f5e9;
    padding: 2px 10px;
    border-radius: 12px;
}

.gsmtr-section-summary:empty {
    display: none;
}

.gsmtr-toggle-icon {
    font-size: 0.7em;
    color: #888;
    margin-left: auto;
    transition: transform 0.2s ease;
}

.gsmtr-section-collapsed .gsmtr-section-content {
    display: none;
}

.gsmtr-section-content {
    padding-top: 15px;
}

/* Guest Benefits Box */
.gsmtr-guest-benefits-box {
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f7ff 100%);
    border: 1px solid #b8d4f0;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 20px;
}

.gsmtr-guest-benefits-box > p {
    margin: 0 0 12px 0;
    font-size: 0.95em;
}

.gsmtr-benefit-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gsmtr-benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e0e8f0;
}

.gsmtr-benefit-icon {
    font-size: 1.3em;
    flex-shrink: 0;
}

.gsmtr-benefit-item strong {
    display: inline;
    color: #333;
    margin-bottom: 2px;
}

.gsmtr-benefit-item > div > span {
    display: block;
    font-size: 0.85em;
    color: #666;
}

/* FREE Tags in Benefits Box */
.gsmtr-free-tag {
    display: inline-block;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    font-size: 0.65em;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.5px;
}

/* Guest Card Styling */
.gsmtr-guest-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.gsmtr-guest-card-header {
    background: #f5f5f5;
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.gsmtr-guest-badge {
    font-weight: 600;
    color: #444;
    font-size: 0.95em;
}

.gsmtr-guest-card-body {
    padding: 15px;
}

/* Option Buttons */
.gsmtr-guest-option-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.gsmtr-option-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.gsmtr-option-btn:hover {
    border-color: #aaa;
    background: #fafafa;
}

.gsmtr-option-btn-active {
    border-color: #4a90d9;
    background: #e8f2fc;
}

.gsmtr-option-icon {
    font-size: 1.2em;
}

.gsmtr-option-label {
    font-size: 0.85em;
    font-weight: 500;
    color: #333;
    text-align: center;
}

/* FREE Tag on Option Buttons */
.gsmtr-option-free {
    display: inline-block;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    font-size: 0.65em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Guest Fields */
.gsmtr-guest-fields {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.gsmtr-guest-field-group {
    margin-bottom: 12px;
}

.gsmtr-guest-field-group:last-child {
    margin-bottom: 0;
}

.gsmtr-guest-field-group label {
    display: block;
    font-size: 0.85em;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}

.gsmtr-guest-field-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95em;
    box-sizing: border-box;
}

.gsmtr-guest-field-group input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.gsmtr-guest-field-row {
    display: flex;
    gap: 12px;
}

.gsmtr-guest-field-row .gsmtr-guest-field-group {
    flex: 1;
}

/* Mobile responsive for accordion and guest cards */
@media (max-width: 600px) {
    .gsmtr-guest-option-buttons {
        flex-direction: column;
    }

    .gsmtr-option-btn {
        flex-direction: row;
        justify-content: center;
        gap: 8px;
    }

    .gsmtr-guest-field-row {
        flex-direction: column;
        gap: 0;
    }

    .gsmtr-benefit-options {
        gap: 8px;
    }

    .gsmtr-benefit-item {
        padding: 8px 10px;
    }

    .gsmtr-section-title {
        font-size: 0.95em !important;
    }

    .gsmtr-section-summary {
        font-size: 0.7em;
        padding: 2px 8px;
    }

    .gsmtr-toggle-icon {
        font-size: 0.6em;
    }
}
