/**
 * Authentication Page Styles
 * Styles for sign-in, sign-up, and home pages
 * Theme-aware and mobile-responsive
 */

/* Auth Section */
.auth-section {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-container {
    max-width: 500px;
    width: 100%;
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 3rem 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.auth-header-text h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #1a1a1a);
}

.auth-header-text p {
    font-size: 1rem;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 2rem;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.auth-footer-text {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
}

.auth-footer-text a {
    color: var(--primary-color, #2563eb);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer-text a:hover {
    text-decoration: underline;
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    min-width: 240px;
    background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, var(--secondary-color, #1e40af) 100%);
    color: var(--white);
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    opacity: 0.95;
}

/* Auth Header */
.auth-header {
    background: var(--header-bg, #ffffff);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    padding: 1rem 0;
}

/* Join Ladder Page Styles */
.join-ladder-section {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.join-ladder-card {
    max-width: 600px;
    width: 100%;
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 3rem 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.join-ladder-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #1a1a1a);
}

.join-subtitle {
    font-size: 1rem;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 2rem;
}

.join-ladder-info {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-light, rgba(0, 0, 0, 0.05));
    border-radius: 8px;
}

.ladder-details h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.ladder-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
}

.ladder-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
}

.ladder-meta-item .material-symbols-outlined {
    font-size: 1.125rem;
}

.join-auth-section,
.join-ready-section,
.join-success-section {
    margin: 2rem 0;
}

.auth-required-message,
.ready-message,
.success-message,
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.auth-required-message .material-symbols-outlined,
.ready-message .material-symbols-outlined,
.success-message .material-symbols-outlined,
.error-message .material-symbols-outlined {
    font-size: 3rem;
    color: var(--primary-color);
}

.error-message .material-symbols-outlined {
    color: var(--error-color, #dc2626);
}

.success-message h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.join-error-section {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 8px;
    border: 1px solid var(--error-color, #dc2626);
}

.join-error-section .error-message {
    margin: 0;
}

.join-error-section .error-message p {
    color: var(--error-color, #dc2626);
    margin: 0;
}

/* Home Page Styles */
.home-main {
    padding: 3rem 1rem;
    min-height: calc(100vh - 200px);
}

.home-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.home-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary, #1a1a1a);
}

.home-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 3rem;
}

.user-profile-section {
    margin: 3rem auto;
    max-width: 800px;
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#user-profile-container {
    min-height: 400px;
}

#user-button-container {
    display: inline-block;
}

.home-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .auth-container {
        padding: 2rem 1.5rem;
    }

    .auth-header-text h1 {
        font-size: 1.75rem;
    }

    .home-title {
        font-size: 2rem;
    }

    .home-subtitle {
        font-size: 1.125rem;
    }

    .home-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .home-actions .btn {
        width: 100%;
    }
}

/* Theme-aware adjustments */
.theme-wimbledon .auth-container,
.theme-roland-garros .auth-container,
.theme-australian-open .auth-container,
.theme-us-open .auth-container {
    background: var(--card-bg);
}

.theme-wimbledon .auth-header-text h1,
.theme-roland-garros .auth-header-text h1,
.theme-australian-open .auth-header-text h1,
.theme-us-open .auth-header-text h1 {
    color: var(--text-primary);
}

/* Clerk Component Integration */
.cl-component {
    /* Ensure Clerk components are visible and styled properly */
    width: 100%;
}

/* Loading states */
.auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.auth-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color, #e5e7eb);
    border-top-color: var(--primary-color, #2563eb);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

