/* Beta Landing Page Styles */

.beta-container {
    display: flex;
    min-height: calc(100vh - 73px); /* Full height minus nav */
    background: var(--background);
}

/* Canvas Section */
.canvas-section {
    flex: 1;
    position: relative;
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#stringCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 2;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.racquet-outline {
    position: absolute;
    max-height: 75vh;
    width: auto;
    height: auto;
    pointer-events: none;
    opacity: 0.95;
    z-index: 1;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.canvas-instructions {
    position: absolute;
    top: var(--spacing-md);
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 3;
    pointer-events: none;
    animation: fadeInDown 0.6s ease-out;
}

.canvas-instructions p {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.canvas-hint {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

.btn-reset {
    position: absolute;
    bottom: var(--spacing-xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    z-index: 3;
}

.btn-reset:hover {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-md);
}

.btn-reset svg {
    animation: rotate 2s linear infinite paused;
}

.btn-reset:hover svg {
    animation-play-state: running;
}

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

/* Color Picker */
.color-picker {
    position: absolute;
    top: var(--spacing-xl);
    right: var(--spacing-xl);
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 3;
    animation: fadeIn 0.5s ease-out;
}

.color-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.color-options {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--spacing-sm);
}

.color-btn {
    width: 36px;
    height: 36px;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.color-btn.active {
    border-color: var(--text-primary);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

/* Form Section */
.form-section {
    flex: 0 0 480px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    overflow-y: auto;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.06);
}

.form-wrapper {
    width: 100%;
    max-width: 420px;
}

.form-header {
    margin-bottom: var(--spacing-2xl);
}

.form-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.form-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Form Styles */
.beta-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input.error {
    border-color: var(--error);
}

.error-message {
    font-size: 0.875rem;
    color: var(--error);
    display: none;
}

.error-message.show {
    display: block;
}

/* Button Styles */
.btn-block {
    width: 100%;
    margin-top: var(--spacing-md);
}

#submitButton {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
}

#submitButton:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.button-spinner {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-spinner svg {
    animation: spin 0.8s linear infinite;
}

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

/* Success Message */
.success-message {
    text-align: center;
    animation: fadeInUp 0.5s ease-out;
}

.success-icon {
    margin-bottom: var(--spacing-lg);
    animation: scaleIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.success-message h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.success-message p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-2xl);
    line-height: 1.6;
}

/* Error Alert */
.error-alert {
    padding: var(--spacing-md) var(--spacing-lg);
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    border-radius: var(--radius-md);
    color: #991B1B;
    margin-bottom: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-xs);
}

.error-alert strong {
    font-weight: 600;
}

/* Confetti Container */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* Responsive Design */

/* Tablet and below */
@media (max-width: 1024px) {
    .beta-container {
        flex-direction: column;
    }

    .canvas-section {
        min-height: 50vh;
        height: 50vh;
    }

    .form-section {
        flex: 1;
        padding: var(--spacing-2xl) var(--spacing-lg);
    }

    .racquet-outline {
        max-height: 60vh;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .canvas-section {
        min-height: 60vh;
        height: 60vh;
        position: relative;
    }

    .form-section {
        padding: var(--spacing-xl) var(--spacing-md);
    }

    .form-header h1 {
        font-size: 2rem;
    }

    .form-header p {
        font-size: 1rem;
    }

    /* Move instructions to very top, no overlap */
    .canvas-instructions {
        top: 0;
        padding: 8px 16px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 0 0 12px 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(10px);
    }

    .canvas-instructions p {
        font-size: 0.8rem;
        margin: 0;
        line-height: 1.3;
    }

    .canvas-hint {
        font-size: 0.7rem;
        margin-top: 2px;
    }

    /* Smaller racquet on mobile to fit everything */
    .racquet-outline {
        max-height: 38vh;
        margin-top: 60px;
    }

    .btn-reset {
        bottom: 130px;
        font-size: 0.8125rem;
        padding: var(--spacing-xs) var(--spacing-md);
    }

    .success-message h2 {
        font-size: 1.5rem;
    }

    .success-message p {
        font-size: 1rem;
    }

    /* Color picker on mobile - at bottom, not overlapping racquet */
    .color-picker {
        position: absolute;
        top: auto;
        bottom: 16px;
        right: var(--spacing-md);
        left: var(--spacing-md);
        padding: 10px;
        max-width: 100%;
    }

    .color-label {
        font-size: 0.7rem;
        margin-bottom: 6px;
    }

    .color-options {
        grid-template-columns: repeat(6, 1fr);
        gap: 6px;
    }

    .color-btn {
        width: 30px;
        height: 30px;
        border-width: 2px;
    }
}

/* Touch Device Optimization */
@media (hover: none) and (pointer: coarse) {
    #stringCanvas {
        cursor: none;
    }

    .form-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .canvas-section {
        background: white;
    }

    .racquet-outline {
        opacity: 1;
    }

    .btn-reset {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .canvas-instructions,
    .success-message,
    .success-icon,
    .btn-reset svg {
        animation: none;
    }

    .confetti {
        animation-duration: 1s;
    }
}
