/**
 * ShuttleOS Frontend Styles - Modern & Exciting
 */

:root {
    --shuttle-primary: #0073aa;
    --shuttle-primary-dark: #005177;
    --shuttle-accent: #00d4ff;
    --shuttle-success: #46b450;
    --shuttle-error: #dc3232;
    --shuttle-bg-glass: rgba(255, 255, 255, 0.85);
    --shuttle-border-glass: rgba(255, 255, 255, 0.5);
    --shuttle-shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --shuttle-radius: 16px;
    --shuttle-transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shuttle-font: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap');

/* Main Container - Glassmorphism */
.shuttleos-widget {
    border: 1px solid var(--shuttle-border-glass);
    padding: 30px;
    border-radius: var(--shuttle-radius);
    background: var(--shuttle-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shuttle-shadow-glass);
    max-width: 450px;
    margin: 40px auto;
    font-family: var(--shuttle-font);
    color: #333;
    animation: slideUpFade 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

/* Subtle gradient border effect */
.shuttleos-widget::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--shuttle-primary), var(--shuttle-accent));
}

.shuttleos-widget h3 {
    margin-top: 0;
    margin-bottom: 25px;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--shuttle-primary-dark);
    text-align: center;
    letter-spacing: -0.5px;
}

/* Form Groups */
.shuttleos-form-group {
    margin-bottom: 20px;
    position: relative;
}

.shuttleos-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #555;
    transition: var(--shuttle-transition);
}

.shuttleos-form-group input,
.shuttleos-form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: rgba(255,255,255,0.9);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--shuttle-transition);
    box-sizing: border-box;
}

.shuttleos-form-group input:focus,
.shuttleos-form-group select:focus {
    outline: none;
    border-color: var(--shuttle-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
    transform: translateY(-1px);
}

/* Buttons */
.shuttleos-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--shuttle-primary), var(--shuttle-primary-dark));
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 81, 119, 0.3);
    transition: var(--shuttle-transition);
    position: relative;
    overflow: hidden;
}

.shuttleos-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 81, 119, 0.4);
    background: linear-gradient(135deg, var(--shuttle-primary), var(--shuttle-primary-dark));
}

.shuttleos-btn:active {
    transform: translateY(0);
}

.shuttleos-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Trip Items */
.shuttleos-trip-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shuttleos-trip-item {
    border: 1px solid transparent;
    padding: 15px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: var(--shuttle-transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    animation: fadeInStagger 0.5s ease-out forwards;
    opacity: 0;
}

/* Stagger delay for up to 10 items */
.shuttleos-trip-item:nth-child(1) { animation-delay: 0.1s; }
.shuttleos-trip-item:nth-child(2) { animation-delay: 0.2s; }
.shuttleos-trip-item:nth-child(3) { animation-delay: 0.3s; }
.shuttleos-trip-item:nth-child(4) { animation-delay: 0.4s; }
.shuttleos-trip-item:nth-child(5) { animation-delay: 0.5s; }

.shuttleos-trip-item:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: var(--shuttle-accent);
}

.shuttleos-trip-item.selected {
    background: #f0f9ff;
    border-color: var(--shuttle-primary);
    box-shadow: 0 0 0 2px var(--shuttle-primary) inset;
}

.trip-time {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--shuttle-primary-dark);
}

.trip-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.trip-price {
    font-weight: 600;
    color: var(--shuttle-success);
}

.trip-seats {
    font-size: 0.85rem;
    color: #888;
}

/* Small/Secondary Button */
.shuttleos-btn-small {
    background: transparent;
    border: 1px solid var(--shuttle-primary);
    color: var(--shuttle-primary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--shuttle-transition);
    display: inline-block;
    margin-top: 10px;
}

.shuttleos-btn-small:hover {
    background: var(--shuttle-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 115, 170, 0.2);
}

/* Notifications */
.shuttleos-error {
    background: #fee;
    color: var(--shuttle-error);
    padding: 12px;
    border-radius: 8px;
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    border-left: 4px solid var(--shuttle-error);
    animation: shake 0.4s ease-in-out;
}

.shuttleos-success {
    background: #eef9ee;
    color: var(--shuttle-success);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #c3e6cb;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

/* QR Code Section */
.shuttleos-qr {
    text-align: center;
    margin: 25px 0;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
    border: 1px dashed #ddd;
}

.shuttleos-qr img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* OTP Section */
#otp-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
    animation: slideDown 0.4s ease-out;
}

/* Animations */
@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInStagger {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

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

/* Loading Spinner */
.shuttleos-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Navigation Buttons */
.shuttleos-nav-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.shuttleos-btn-secondary {
    padding: 14px;
    background: transparent;
    border: 1px solid var(--shuttle-primary);
    color: var(--shuttle-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
    transition: var(--shuttle-transition);
}

.shuttleos-btn-secondary:hover {
    background: rgba(0, 115, 170, 0.05);
}

/* Summary Card */
.shuttleos-summary-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

.summary-row:last-child {
    border-bottom: none;
}

.total-row {
    font-size: 1.2rem;
    color: var(--shuttle-primary-dark);
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #eee;
}

/* Responsive */
@media (max-width: 480px) {
    .shuttleos-widget {
        margin: 20px;
        padding: 20px;
    }
}

/* Step Indicators */
.shuttleos-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 25px;
    gap: 8px;
}

.shuttleos-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.shuttleos-step-dot.active {
    background: var(--shuttle-primary);
    transform: scale(1.3);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Error UI */
.shuttleos-input-error {
    border-color: #dc3232 !important; /* WordPress red */
    background-color: #fff8f8;
}

.shuttleos-error-text {
    color: #dc3232;
    font-size: 0.85rem;
    margin-top: 4px;
    display: block;
    animation: slideUpFade 0.3s ease-out;
}

.shuttleos-form-error {
    background-color: #fcebeb;
    border: 1px solid #dc3232;
    color: #dc3232;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: none; /* hidden by default */
    animation: shake 0.4s ease-in-out;
}
