/* Authentication styles for Golf Handicap Tracker */

.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.auth-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    margin-bottom: 20px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: #4CAF50;
    margin: 0 0 10px 0;
    font-size: 2em;
}

.auth-header p {
    color: #666;
    margin: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    color: #333;
}

.form-group input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #4CAF50;
}

.auth-form button {
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-form button:hover:not(:disabled) {
    background: #45a049;
}

.auth-form button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.auth-toggle {
    text-align: center;
    margin-top: 20px;
}

.auth-toggle p {
    margin: 0 0 10px 0;
    color: #666;
}

.auth-toggle button {
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
}

.auth-toggle button:hover {
    color: #45a049;
}

.auth-error {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #c62828;
    display: none;
}

.auth-success {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2e7d32;
    display: none;
}

.forgot-password-link {
    text-align: center;
    margin-top: 15px;
}

.forgot-password-link button {
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
}

.forgot-password-link button:hover {
    color: #45a049;
}

/* User info styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-left: auto;
}

.user-email {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.btn-secondary {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-sync {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.btn-sync:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.btn-sync:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sync status styles */
.sync-status {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
}

.sync-status.syncing {
    background: rgba(255, 193, 7, 0.2);
    color: #ff6f00;
}

.sync-status.synced {
    background: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
}

.sync-status.error {
    background: rgba(244, 67, 54, 0.2);
    color: #c62828;
}

.sync-status.offline {
    background: rgba(158, 158, 158, 0.2);
    color: #424242;
}

.sync-status.online {
    background: rgba(33, 150, 243, 0.2);
    color: #1565c0;
}

/* Sync notification styles */
.sync-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

.sync-notification.success {
    background: #4caf50;
    color: white;
}

.sync-notification.error {
    background: #f44336;
    color: white;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .auth-container {
        padding: 10px;
    }
    
    .auth-card {
        padding: 20px;
    }
    
    .auth-header h1 {
        font-size: 1.5em;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
        padding: 8px;
    }
    
    .user-email {
        font-size: 12px;
    }
    
    .btn-secondary, .btn-sync {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .sync-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
}

/* Hide app container when not authenticated */
#app-container {
    display: none;
}

/* Show auth container by default */
#auth-container {
    display: block;
}

/* Form container display management */
.auth-form-container {
    display: none;
}

.auth-form-container.active {
    display: block;
}

/* Password strength indicator */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 5px;
    background: #ddd;
    transition: all 0.3s ease;
}

.password-strength.weak {
    background: #f44336;
    width: 33%;
}

.password-strength.medium {
    background: #ff9800;
    width: 66%;
}

.password-strength.strong {
    background: #4caf50;
    width: 100%;
}

/* Loading animation */
.auth-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

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